solid.Shape

Methods

Method Reference: solid.Shape.projection

solid.Shape: R = projection (S)

solid.Shape: R = projection (S, U)

Outline of a shape seen along a direction.

R = projection (S, U) projects the shape S along the normal of the geom.UCS U onto its plane and returns the area it covers as a 1-by-N cell array of geom.Region objects in U, one for each separate piece of it, largest first. This is the shadow the shape casts on the plane in light falling along the normal: a bore seen along its axis is a hole in the outline, and seen from the side it is not there. A piece standing in a hole of another is a piece of its own. Where the plane lies along its normal changes only the plane the regions lie in. The empty shape has no outline, and R is the empty cell (1, 0).

R = projection (S) projects onto the xy plane, as seen from above, which is what OpenSCAD’s projection does.

The outline is drawn from the edges of S and the outlines of its curved faces. Straight edges are straight segments and a circle seen square on is a circle; a circle seen at a slant is the ellipse it makes, and the outline of a cylinder, a cone or a sphere is exact too. That of a torus or of a spline surface is the B-spline Open CASCADE fits to it. section cuts a shape with a plane instead.

 
 ## A plate with a bore, seen from above and from the front
 S = subtract (solid.box (80, 40, 12), ...
               translate (solid.cylinder (4, 12), [20, 20, 0]));
 top = projection (S);
 numel (top{1}.Holes)
 ⇒ 1
 front = projection (S, geom.UCS ([0, -1, 0], [0, 0, 0]));
 numel (front{1}.Holes)
 ⇒ 0

See also: solid.Shape.section, geom.Region, geom.UCS

Source Code: solid.Shape