solid.Shape

Methods

Method Reference: solid.Shape.Shape

solid.Shape: S = solid.Shape ()

solid.Shape: S = solid.Shape (DATA)

Make a shape.

S = solid.Shape () returns the empty shape, which holds nothing.

S = solid.Shape (DATA) wraps DATA, the bytes of a shape in Open CASCADE’s binary format. This is how the functions of the solid namespace return what Open CASCADE computed, and it is not for direct use: bytes that do not begin with that format’s signature are refused.

The empty shape is where a shape built up in a loop starts: it adds nothing to a union, so the first pass needs no case of its own.

 
 ## A stair of four steps, gathered from nothing
 S = solid.Shape ();
 for k = 1:4
   step = solid.box (40, 10, 5 * k);
   S = union (S, translate (step, [0, 10 * (k - 1), 0]));
 endfor
 numsolids (S)
 ⇒ 1

Source Code: solid.Shape