Curve
The PMI object that allows to add any line paths on model.
New in version 1.6.0: A curve object.
Object
Each curve object is created/removed by add/delete annotation commands. It may be received also by get parameters command. Everywhere uses the same type to represent a visual object.
Common type of a curve object (TypeScript):
export type C3DViewCurve = {
type: C3DViewObjectTypes.Curve
uuid?: string
points: C3DViewPoint[]
options: C3DViewCurveOptions
userData: C3DUserData
}
type: Necessarily field, value is
C3DViewObjectTypes.Curve
or string"Curve"
.uuid: Unique identifier of a curve object.
points: A path points.
options: Additional options.
userData: Custom user data for object.
Note
The new object will be created if the uuid
isn’t present.
The exist object with be update if the uuid
if the id belongs to it.
Additional options
Type of a curve options (TypeScript):
export type C3DViewCurveOptions = {
colors?: {
lines?: C3DViewRGB
}
}
colors: Grouped values to change colors of graphics object:
lines:
{r,g,b}
values of a frame wire color.
Note
The default color ({r: 0, g: 0, b:0}
) will used without lines
color setting.
User data
Custom user object that can be attached to every object.
Later they can be obtained using the command with GetParametersTypes.AnnotationList
as a type.
export type C3DUserData = object|undefined;
Example
Adding the new curve command example (TypeScript):
view.runCommand({
name: "AddAnnotation",
objs: [
{
type: "Curve",
points: [
{x: 10, y: 0, z: 0},
{x: 10, y: 10, z: 0},
{x: 0, y: 10, z: 0},
],
options: {
fill: {r: 255, g: 0, b: 0},
},
}
]
})