Markup
Below we will consider the PMI object containing 2D primitives and usually used for markup purposes.
Object
Common type of the markup object (TypeScript):
export type C3DViewMarkup = {
type: C3DViewObjectTypes.Markup
uuid?: string
content: string
position: {
plane: C3DViewPlacement
view: {
positionDist: number
targetDist: number
projection: CameraProjection
}
}
userData: C3DUserData
}
Let’s consider the options of this object.
The properties type, uuid, and userData are described here. Additionally for this PMI object:
type can be
C3DViewObjectTypes.Markup
or a string"Markup"
;userData object can be obtained later using the command with
GetParametersTypes.AnnotationList
as a type.
content is a string which should contain data in the svg format. The data describes every primitive of a markup object as the corresponding svg element, i.e. for example, the markup line segment is converted to the svg line and vice versa. A markup object can both write itself into and read from this string.
position is a group of parameters to position an object in the scene:
plane is a placement of object;
view is a group of parameters to set the correct view onto an object:
positionDist is a distance from an origin point of object to the camera position;
targetDist is a distance from an origin point of object to the camera target (a 3D model in the scene);
projection is a camera projection.