Manakin
Human Stick Figure
1
basePoint=Point.Origin();
2
h=stature;
3
s=Point.ByCartesianCoordinates(CoordinateSystem.ByOrigin(basePoint),-0.0955*h,0,0);
4
dirX=Vector.XAxis();
5
dirY=Vector.YAxis();
6
dirZ=Vector.ZAxis();
7
sll1=Line.ByStartPointDirectionLength(s,dirZ,0.039*h);
8
sll2=Line.ByStartPointDirectionLength(sll1.EndPoint,dirZ,0.246*h);
9
dlkn=seated?dirY.Reverse():dirZ;
10
sll3=Line.ByStartPointDirectionLength(sll2.EndPoint,dlkn,0.245*h);
11
shp1=Line.ByStartPointDirectionLength(sll3.EndPoint,dirX,0.191*h);
12
drkn=seated?dirY:dirZ.Reverse();
13
slr3=Line.ByStartPointDirectionLength(shp1.EndPoint,drkn,0.245*h);
14
slr2=Line.ByStartPointDirectionLength(slr3.EndPoint,dirZ.Reverse(),0.246*h);
15
slr1=Line.ByStartPointDirectionLength(slr2.EndPoint,dirZ.Reverse(),0.039*h);
16
ssp1=Line.ByStartPointDirectionLength(shp1.PointAtParameter(0.5),dirZ,0.288*h);
17
slh1=Line.ByStartPointDirectionLength(ssp1.EndPoint,dirX.Reverse(),0.1295*h);
18
slh2=Line.ByStartPointDirectionLength(slh1.EndPoint,dirZ.Reverse(),0.186*h);
19
slh3=Line.ByStartPointDirectionLength(slh2.EndPoint,elbowBent?dirY:dirZ.Reverse(),0.146*h);
20
slh4=Line.ByStartPointDirectionLength(slh3.EndPoint,elbowBent?dirY:dirZ.Reverse(),0.108*h);
21
srh1=Line.ByStartPointDirectionLength(ssp1.EndPoint,dirX,0.1295*h);
22
srh2=Line.ByStartPointDirectionLength(srh1.EndPoint,dirZ.Reverse(),0.186*h);
23
srh3=Line.ByStartPointDirectionLength(srh2.EndPoint,elbowBent?dirY:dirZ.Reverse(),0.146*h);
24
srh4=Line.ByStartPointDirectionLength(srh3.EndPoint,elbowBent?dirY:dirZ.Reverse(),0.108*h);
25
chn1=Line.ByStartPointDirectionLength(ssp1.EndPoint,dirZ,0.051*h);
26
hed1=Circle.ByCenterPointRadiusNormal((chn1.EndPoint).Translate(dirZ,h*0.0655),h*0.0655,dirY);
27
sktn=[sll1,sll2,sll3,shp1,slr3,slr2,slr1,ssp1,slh1,slh2,slh3,slh4,srh1,srh2,srh3,srh4,chn1,hed1];
28
psnrt=sktn.Rotate(basePoint,dirZ,rotate);
29
//Reach boundary extents
30
rlxl=1.1;
31
rlxh=1.2;
32
rchll=Surface.ByPatch(Circle.ByCenterPointRadiusNormal(shp1.StartPoint,0.530*h*rlxl,dirY));
33
rchrl=Surface.ByPatch(Circle.ByCenterPointRadiusNormal(shp1.EndPoint,0.530*h*rlxl,dirY));
34
rchlh=Surface.ByPatch(Circle.ByCenterPointRadiusNormal(slh1.StartPoint,0.440*h*rlxh,dirY));
35
rchrh=Surface.ByPatch(Circle.ByCenterPointRadiusNormal(srh1.StartPoint,0.440*h*rlxh,dirY));
36
rchsol1=Solid.ByUnion([rchll.Thicken(h*0.001,true),rchrl.Thicken(h*0.001,true),rchlh.Thicken(h*0.001,true),rchrh.Thicken(h*0.001,true)]);
37
rchsol=rchsol1.Trim(Plane.ByOriginNormal(basePoint,Vector.ZAxis()),basePoint.Add(Vector.ByCoordinates(0,0,-1)));
38
rchsur=rchsol.Intersect(Plane.ByOriginNormal(rchsol1.Centroid(),Vector.YAxis()));
39
rchper=Flatten(rchsur.PerimeterCurves());
40
rchpnt1=Flatten(rchper<1><2>.PointAtParameter(0.1..0.9..#6)<1>);
41
rchpnt=rchpnt1.Rotate(basePoint,dirZ,rotate);
42
rchcur=NurbsCurve.ByControlPoints(rchpnt,3,true);
Copied!
Dynamanikin.zip
2KB
Binary
Last modified 1yr ago
Copy link