Extruded Solid Along the Path in a plane.
Creates an extruded solid by given the profile and an extrusion path.
// Create an Ellipse
sdEllipse el = draw.Document.CreateEllipse(new Point3D(0, 0, 0), 20, 40, 0);
sdLwPolyline LwLine = draw.Document.CreateLwPolyline();
LwLine.AddVertex(new Point3D(0, 0, 0));
LwLine.AddVertex(new Point3D(100, 0, 0));
LwLine.AddVertex(new Point3D(100, 100, 0));
LwLine.AddVertex(new Point3D(200, 100, 0));
LwLine.FilletRadius(40);
sd3dSolid solid = draw.Document.AddSolidExtruded(el, LwLine);
// Dispose it when it is no longer needed.
el.Dispose();
Extruded Solid Along Z axis.
Creates an extruded solid by given the profile and height of extrusion.
sdEllipse el = fDrawCtrl1.Document.CreateEllipse(new Point3D(0, 0, 0), 20, 40, 0);
fDrawCtrl1.Document.AddSolidExtruded(el, 50);
// Dispose the entity which is no longer needed.
el.Dispose();
Extruded Solid Along the Path in 3D space.
// Create a 3D polyline.
sdPolyline poly = fDrawCtrl1.Document.AddPolyline();
// Create a helix polyline.
double sudut, theta;
double DUAPI = 2 * 22 / 7.0;
int bil = 20;
theta = DUAPI / (bil);
double radius = 2;
double h = 0;
double speed = 0.2;
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < bil; j++)
{
sudut = (j) * theta;
Point3D tmp = new Point3D(0, 0, 0);
tmp.X = radius * Math.Cos(sudut);
tmp.Y = radius * Math.Sin(sudut);
tmp.z = h;
poly.AddVertex(tmp);
h+=speed;
}
}
// Create a triangle profile
sdLwPolyline po = fDrawCtrl1.Document.CreateLwPolyline();
po.AddVertex(new Point3D(0, 0, 0));
po.AddVertex(new Point3D(2, 1, 0));
po.AddVertex(new Point3D(2, -1, 0));
// Create extruded solid along the path.
sd3dSolid solid = fDrawCtrl1.Document.AddSolidExtruded(po, poly.VertexList);