Skip to main content
removed code that wasn't doing anything
Source Link
Bob Hanlon
  • 162.6k
  • 7
  • 81
  • 205

Plotting, (EDIT: removed line of code that wasn't doing anything )

Manipulate[
 Legended[
  Show[
   lpp3d,
   Graphics3D[
    Table[
     Flatten[
      {If[MemberQ[selection, n],
        {EdgeForm[Thick], Lighter[Red, 0.25]},
        Nothing],
       Polygon[vertices[[faces[[n]]]]]}],
     {n, Range[Length[faces]]}],
    MapIndexed[Text[#2[[1]], #1] &, vertices]]]],
   AxesLabel -> {x, y, z},
   BoxRatios -> Automatic,
   ImageSize -> Medium],
  PointLegend[
   ColorData[97] /@ rlGV, rlGV,
   LegendLabel -> "Group"]],
 Row[{
   Control[{{selection, {1}, "highlight face"},
     Range[Length[faces]],
     ControlType -> TogglerBar}],
   Spacer[40],
   Button[Style["Clear All", 10], selection = {}]}],
 SynchronousUpdating -> False,
 TrackedSymbols :> {selection}]

Plotting,

Manipulate[
 Legended[
  Show[
   lpp3d,
   Graphics3D[
    Table[
     Flatten[
      {If[MemberQ[selection, n],
        {EdgeForm[Thick], Lighter[Red, 0.25]},
        Nothing],
       Polygon[vertices[[faces[[n]]]]]}],
     {n, Range[Length[faces]]}],
    MapIndexed[Text[#2[[1]], #1] &, vertices]],
   AxesLabel -> {x, y, z},
   BoxRatios -> Automatic,
   ImageSize -> Medium],
  PointLegend[
   ColorData[97] /@ rlGV, rlGV,
   LegendLabel -> "Group"]],
 Row[{
   Control[{{selection, {1}, "highlight face"},
     Range[Length[faces]],
     ControlType -> TogglerBar}],
   Spacer[40],
   Button[Style["Clear All", 10], selection = {}]}],
 SynchronousUpdating -> False,
 TrackedSymbols :> {selection}]

Plotting, (EDIT: removed line of code that wasn't doing anything )

Manipulate[
 Legended[
  Show[
   lpp3d,
   Graphics3D[
    Table[
     Flatten[
      {If[MemberQ[selection, n],
        {EdgeForm[Thick], Lighter[Red, 0.25]},
        Nothing],
       Polygon[vertices[[faces[[n]]]]]}],
     {n, Range[Length[faces]]}]],
   AxesLabel -> {x, y, z},
   BoxRatios -> Automatic,
   ImageSize -> Medium],
  PointLegend[
   ColorData[97] /@ rlGV, rlGV,
   LegendLabel -> "Group"]],
 Row[{
   Control[{{selection, {1}, "highlight face"},
     Range[Length[faces]],
     ControlType -> TogglerBar}],
   Spacer[40],
   Button[Style["Clear All", 10], selection = {}]}],
 SynchronousUpdating -> False,
 TrackedSymbols :> {selection}]
Source Link
Bob Hanlon
  • 162.6k
  • 7
  • 81
  • 205

Clear["Global`*"]

C0 = 1;
C1 = 2;

groupedVertices = {{{0, 0, C1}, {0, 0, -C1}, {C1, 0, 0}, {-C1, 0, 
     0}, {0, C1, 0}, {0, -C1, 0}}, {{C0, C0, C0}, {C0, 
     C0, -C0}, {C0, -C0, C0}, {C0, -C0, -C0}, {-C0, C0, C0}, {-C0, 
     C0, -C0}, {-C0, -C0, C0}, {-C0, -C0, -C0}}};

vertices = Flatten[groupedVertices, 1];

faces = {{7, 1, 9, 3}, {7, 3, 8, 5}, {7, 5, 11, 1}, {10, 2, 8, 
    3}, {10, 3, 9, 6}, {10, 6, 14, 2}, {12, 2, 14, 4}, {12, 4, 11, 
    5}, {12, 5, 8, 2}, {13, 1, 11, 4}, {13, 4, 14, 6}, {13, 6, 9, 1}};

rlGV = Range[Length[groupedVertices]];

lpp3d = ListPointPlot3D[
   Map[# -> Position[vertices, #][[1, 1]] &,
    groupedVertices, {2}],
   LabelingFunction -> Callout,
   PlotStyle -> (
     Directive[ColorData[97][#],
        PointSize[0.05]] & /@
      rlGV)];

Plotting,

Manipulate[
 Legended[
  Show[
   lpp3d,
   Graphics3D[
    Table[
     Flatten[
      {If[MemberQ[selection, n],
        {EdgeForm[Thick], Lighter[Red, 0.25]},
        Nothing],
       Polygon[vertices[[faces[[n]]]]]}],
     {n, Range[Length[faces]]}],
    MapIndexed[Text[#2[[1]], #1] &, vertices]],
   AxesLabel -> {x, y, z},
   BoxRatios -> Automatic,
   ImageSize -> Medium],
  PointLegend[
   ColorData[97] /@ rlGV, rlGV,
   LegendLabel -> "Group"]],
 Row[{
   Control[{{selection, {1}, "highlight face"},
     Range[Length[faces]],
     ControlType -> TogglerBar}],
   Spacer[40],
   Button[Style["Clear All", 10], selection = {}]}],
 SynchronousUpdating -> False,
 TrackedSymbols :> {selection}]

enter image description here