PMI Geometry
Below we will consider the geometry that can be added to a client side model. Such objects are a dynamic part of a model.
The C3D Web Vision supports the following types of objects:
export enum C3DViewObjectTypes
{
Comment = "Comment",
Markup = "Markup",
LineDimension = "LineDimension",
PathDimension = "PathDimension",
AngleDimension = "AngleDimension",
RadialDimension = 'RadialDimension',
Box = "Box",
Sphere = "Sphere",
Curve = "Curve"
}
New in version 1.5.0: Added new dimensions (see Dimensions page).
New in version 1.6.0: Added the box, sphere and curve objects.
New in version 1.8.0: Added new dimensions (see Dimensions page).
Representation
Each object is represented with the typed object which has the properties special for an object. Nevertheless, each type also has the common things as follows.
Extract from some object type (TypeScript):
export type C3DView... = {
type: C3DViewObjectTypes
uuid?: string
...special properties...
userData: C3DUserData
}
type is a required field that defines a type of object;
uuid is an unique identifier of object;
userData is a user object data.
New in version 1.6.0: Made the uuid parameter optional. The object UUID is generated without it.
Note
If the uuid isn’t present, a new object is created. On the contrary, if the uuid is present and is equal to an uuid of some existing object, the latter is updated.
Adding Object
To add any object to a scene, you should use the AddAnnotation command.
Example of adding a comment object (TypeScript):
view.runCommand({
name: "AddAnnotation",
objs: [{
type: C3DViewObjectTypes.Comment, // "Comment"
uuid: "26405536-2d18-48db-968e-ebc536d0a572",
points: {
target: {x:0, y:0, z:0},
shelf: {x:100, y:20, z:0},
},
options: {
text: "My comment",
}
}],
})
Note
It’s recommended to use processes to add objects in interactive mode.
User Data
Each PMI object has a custom object to store some user’s information. The representation of it is the same for all objects.
export type C3DUserData = object | undefined
The creation of a user data object depends on which method is used to create a PMI object.