// create a CoordinateSystem at a specific location,// no rotations, scaling, or sheering transformationsx_pos =3.6;y_pos =9.4;z_pos =13.0;origin =Point.ByCoordinates(x_pos, y_pos, z_pos);identity =CoordinateSystem.Identity();cs =CoordinateSystem.ByOriginVectors(origin,identity.XAxis,identity.YAxis,identity.ZAxis);
// create a point with x, y, and z coordinatesx_pos =1;y_pos =2;z_pos =3;pCoord =Point.ByCoordinates(x_pos, y_pos, z_pos);// create a point in a specific coordinate systemcs =CoordinateSystem.Identity();pCoordSystem =Point.ByCartesianCoordinates(cs, x_pos, y_pos, z_pos);// create a point on a cylinder with the following// radius and heightradius =5;height =15;theta =75.5;pCyl =Point.ByCylindricalCoordinates(cs, radius, theta, height);// create a point on a sphere with radius and two anglesphi =120.3;pSphere =Point.BySphericalCoordinates(cs, radius, theta, phi);
線分
次に高い次元の Dynamo プリミティブは線分セグメントで、2 つの端点間にある無限の数の点を表します。Line.ByStartPointEndPoint コンストラクタを使用して 2 つの境界点を明示的に指定するか、Line.ByStartPointDirectionLength で開始点、方向、およびその方向の長さを指定することで、線分を作成できます。
p1 =Point.ByCoordinates(-2,-5,-10);p2 =Point.ByCoordinates(6,8,10);// a line segment between two pointsl2pts =Line.ByStartPointEndPoint(p1, p2);// a line segment at p1 in direction 1, 1, 1 with// length 10lDir =Line.ByStartPointDirectionLength(p1,Vector.ByCoordinates(1,1,1),10);
// create a cuboid with specified lengthscs =CoordinateSystem.Identity();cub =Cuboid.ByLengths(cs,5,15,2);// create several conesp1 =Point.ByCoordinates(0,0,10);p2 =Point.ByCoordinates(0,0,20);p3 =Point.ByCoordinates(0,0,30);cone1 =Cone.ByPointsRadii(p1, p2,10,6);cone2 =Cone.ByPointsRadii(p2, p3,6,0);// make a cylindercylCS =cs.Translate(10,0,0);cyl =Cylinder.ByRadiusHeight(cylCS,3,10);// make a spherecenterP =Point.ByCoordinates(-10,-10,0);sph =Sphere.ByCenterPointRadius(centerP,5);