I'm new to Mathematica and have no background whatsoever in programming, although I will teach myself soon. I was wondering if one of you programming pros could help me out. I received a code from an online source. The code is supposed to draw some form of geometry (ie: remove faces from say a cube and make a shell/pipe structure out of its edges) I was under the impression that I had to copy/paste the code in the browser and enter it for it to run. However it doesn't seem to do anything. I'm wondering if the code was meant for an old version of Mathematica, has errors in or perhaps I just don't know how to get it running. Would really appreciate if someone could help me until I get my head around Mathematica/coding.
edgeIndicesOfFace[face_] :=
Select[Transpose[{face, RotateLeft[face]}], (#[[1]] < #[[2]]) &];
edgeIndices[gc_] := Apply[Join, Map[edgeIndicesOfFace, gc[[1, 2, 1]]]];
edges[gc_] := Map[vertices[gc][[#]] &, edgeIndices[gc], {2}];
translateVertices[name_, scale_, xyz_] :=
Map[(xyz + #) &, scale vertices[PolyhedronData[name]]];
strut[name_, scale_, edge_] :=
cHull[Join[translateVertices[name, scale, edge[[1]]],
translateVertices[name, scale, edge[[2]]]]];
edgeModel[name_, nameVertex_, scale_] :=
Apply[Join, Map[strut[nameVertex, scale, #] &, edges[PolyhedronData[name]]]];
view[edgeModel["Cube", "Cube", .2]]
Manipulate[
view[edgeModel[big, small, scale]], {big, PolyhedronData[All]}, {small,
PolyhedronData[All]}, {scale, 0.001, 1}]
vertices
,cHull
,view
in your code? $\endgroup$