Method Generate3dPathSection
- Namespace
- vdWebLibrary
- Assembly
- JsPropertiesExtractor.dll
Generate3dPathSection(object[], object[], object[], double, double, object[], object[], bool, bool, object)
Create a new Polyface object following a given path and drawing a given section
public object Generate3dPathSection(object[] section2d, object[] sectionBasePoint2d, object[] path, double SectionAngle, double SectionScale, object[] startVector, object[] endVector, bool TopBottomFaces, bool drawit, object entities)
Parameters
section2dobject[]Array of one or more closed 2d sections
sectionBasePoint2dobject[]A point relative to sections array that defines the origin of sections. This point will run over the path line
pathobject[]An array of points in real world Coordinate System
SectionAngledoubleAngle in radians that sections will be rotated around base point before they mapped on the path line.
SectionScaledoubleThe ending scale of the section object(the section object will start following the path with scale=1.0 and will end with scale=SectionScale).Set it to 1 for no scale.
startVectorobject[]The extrution vector of the plane of the start section.If it is null the vector of the start segment is used.
endVectorobject[]The extrution vector of the plane of the end section.If it is null the vector of the end segment is used.
TopBottomFacesboolDefines if the start and end caps of the path will be filled.
drawitboolDefines if the polyface object will be drawn.
entitiesobjectThe entities collection where the line will be added. This can be the entities of layout or a block.If not defined then the created entity is added to active layout.
Returns
- object
The created object
Examples
//Example1
var pface = vdcanvas.Generate3dPathSection([[[-0.2, -0.2, 0], [-0.2, 0.2, 0], [0.2, 0.2, 0], [0.2, -0.2, 0], [-0.2, -0.2, 0]]], [0, 0, 0], [[0, 0, 5], [5, 0, 5], [5, -5, 5], [0, -5, 5]], vdgeo.HALF_PI * 0.5, 5, null, null, true);
pface.PenColor = vdConst.colorFromString("1");
//Example2
pface = vdcanvas.Generate3dPathSection([[[-1, -1, 0], [-1, 1, 0], [1, 1, 0], [1, -1, 0], [-1, -1, 0]]], [0, 0, 0], [[0, 0, 0], [5, 0, 0], [5, -5, 0], [0, -5, 0], [0, 0, 0]], 0, 1.0, null, null, false);
pface.PenColor = vdConst.colorFromString("2");
//Example 3
var section = vdcanvas.AddCircle([0, 0, 0], 1, false, {});
var path = vdcanvas.AddCircle([0, 0, 0], 10, false, {});
path.ExtrusionVector = [0, 1, 0];
pface = vdcanvas.Generate3dPathSection([vdcanvas.GetEntitySamplePoints(section)], [0, 0, 0], vdcanvas.GetEntitySamplePoints(path), 0, 1.0, null, null, false);
pface.PenColor = vdConst.colorFromString("3");
//Example 4
var section = vdcanvas.AddCircle([0, 0, 0], 1, false, {});
var path = vdcanvas.AddArc([0, 0, 0], 10, 0, vdgeo.PI, false, {});
path.ExtrusionVector = [1, 0, 0];
pface = vdcanvas.Generate3dPathSection([vdcanvas.GetEntitySamplePoints(section)], [0, 0, 0], vdcanvas.GetEntitySamplePoints(path), 0, 1.0, null, null, true);
pface.PenColor = vdConst.colorFromString("4");
//zoom extets and redraw
vdcanvas.SetStdView(vdConst.StdView_ISO_SW);
vdcanvas.SetRenderMode(vdConst.RENDERMODE_SHADE_ON);
setTimeout(vdcanvas.redraw);