solid.Shape

Methods

Method Reference: solid.Shape.solids

solid.Shape: L = solids (S)

The solids of a shape, one by one.

L = solids (S) returns an N-by-1 struct array, an element for each of the shape’s N solids in the order solid.Shape.numsolids counts them, with the fields:

indexits index, from 1 to N
nameits solid.Shape.Name, '' where it has none
colourits solid.Shape.Colour, a row of NaN where it has none
pathan empty cell, since a shape places nothing
part'', for the same reason

model.Assembly.solids lists the solids of an assembly with the same fields, and model.Viewer.opacity takes the names either gives to choose which solids to hide or show through.

 
 S = union (solid.box (10, 10, 10), ...
            translate (solid.sphere (4), [30, 0, 0]));
 S.Name = {'block'; 'ball'};
 L = solids (S);
 L(2).name
 ⇒ ball

See also: model.Assembly.solids, model.Viewer.opacity, solid.Shape.numsolids

Source Code: solid.Shape