Creates a 3D solid by extruding a closed 2D shape along the Y-Z plane.

syntaxSyntax:
DlxSolid.ExtrudeYZ(xMin, width, mode=0, frontShape=null)

Parameters

Parameter Description
xMin Value of the X coordinate of extrusion start.
width Width of the extruded solid.
mode It can be a combination of the following values:
FWiz.SOLID_SKIPFENCE The faces, of the solid, parallel to the X axis are omitted.
FWiz.SOLID_SKIPFRONTFACE The front face of the solid is omitted.
FWiz.SOLID_SKIPBACKFACE The back face of the solid is omitted.
frontShape A DlxFigure object with the final shape of the extrusion. This shape must consist of the same number of points as the basic shape. If this shape is not specified the basic shape specified in the constructor is used.

Return Value

If the operation ends correctly it returns true otherwise it returns false.

Remarks

The shape being 2D with only X and Y coordinates is adapted to the extrusion plane using the coordinate extraneous to the plane as the value of the coordinate along the Z axis. The extrusion occurs along the X axis then the shape lies on the Y-Z plane and the value of the X coordinate in the shape will be interpreted as the value of the Z coordinate.

Example

  Copy codeCopy code
function OnBuild3DModel()
{
  var ctx = FWiz.Get3DModelCtx();
  var style = FWiz.Get3DStyle(0);
  style.SetStyle("gold");

  var shape = new DlxFigure();
  shape.SetZ(0);
  shape.SetRectangle(0, 0, 20, 20, -25, -25, 30, 30);
  shape.EndShape();

  var shape1 = new DlxFigure();
  shape1.SetZ(10);
  shape1.SetRectangle(0, 0, 10, 10, -25, -25, 30, 30);
  shape1.EndShape();

  var hole = new DlxFigure();
  hole.AddArc(new DlxPoint(0, 0), 3);
  hole.EndShape();

  var obj = new DlxSolid(shape, style);
  obj.AddHole(hole);
  obj.ExtrudeYZ(-5, 10, 0, shape1);
  ctx.Add(obj);
}

See also