Defines a leaf node in the scene graph hierarchy.
A part corresponds to a mechanical part or a product in the product structure hierarchy.
A part may contain one or more bodies.
new Part(
name?):Part
Creates a model element with an optional name.
string | null
Name assigned to the model element.
Part
readonlybodies:Set<Body>
Collection of bodies belonging to the part.
material:
VisualMaterial|null=null
Visual material assigned to the model element.
The default value is null.
get id():
bigint
Returns the unique identifier of the object.
bigint
get name():
string|null
Name of the model element.
The default value is null.
string | null
set name(
name):void
Sets the name of the model element.
string | null
Model element name.
void
get numberOfBodies():
number
Returns the number of bodies in the part.
Use Part.bodies and bodies.size instead.
number
get uuid():
`${string}-${string}-${string}-${string}-${string}`|null
UUID of the model element.
The default value is null.
`${string}-${string}-${string}-${string}-${string}` | null
set uuid(
uuid):void
Sets the UUID of the model element.
`${string}-${string}-${string}-${string}-${string}` | null
Model element UUID.
void
accept(
visitor):void
Accepts an element visitor.
Invokes visitPart() for this part.
Visitor to accept.
void
addBodies(
bodies):void
Adds bodies to the part.
Bodies that are already present in the part are not added again.
Body[]
Bodies to add.
void
Use Part.bodies and bodies.forEach((body) => part.bodies.add(body)) instead.
addBody(
body):void
Adds a body to the part.
If body is already present in the part, it is not added again.
Body to add.
void
Use Part.bodies and bodies.add(body) instead.