Adds a hole to the 3D solid.

syntaxSyntax:
DlxSolid.AddHole(shape, mode=0, depth=0)

Parameters

Parameter Description
shape A DlxFigure object with the shape of the hole.
mode It can be a combination of the following values:
FWiz.SOLID_SKIPFRONTHOLE The hole does not appear in the front face.
FWiz.SOLID_SKIPBACKHOLE The hole does not appear in the back face.
depth If the hole is not through but blind (mode different from 0) this parameter specifies the depth of the hole.

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. If 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. If the extrusion occurs along the Y axis then the shape lies on the X-Z plane and the value of the Y coordinate in the shape will be interpreted as the value of the Z coordinate. If the extrusion occurs along the Z axis then the shape lies on the X-Y plane.

Example

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

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

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

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

See also