RosettaCodeData/Task/Catmull-Clark-subdivision-surface/Mathematica/catmull-clark-subdivision-surface-1.math
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

6 lines
332 B
Text

subSetQ[large_,small_] := MemberQ[large,small]
subSetQ[large_,small_List] := And@@(MemberQ[large,#]&/@small)
containing[groupList_,item_]:= Flatten[Position[groupList,group_/;subSetQ[group,item]]]
ReplaceFace[face_]:=Transpose[Prepend[Transpose[{#[[1]],face,#[[2]]}&/@Transpose[Partition[face,2,1,1]//{#,RotateRight[#]}&]],face]]