Curve

The PMI object that allows adding any line paths on a model.

Object

Common type of a curve object (TypeScript):

export type C3DViewCurve = {
    type: C3DViewObjectTypes.Curve
    uuid?: string
    points: C3DViewPoint[]
    options: C3DViewCurveOptions
    userData: C3DUserData
}

The properties type, uuid, and userData are described here. Additionally for this PMI object:

  • type can be C3DViewObjectTypes.Curve or a string "Curve";

  • userData object can be obtained later using the command with GetParametersTypes.AnnotationList as a type.

  1. points is an array of points making a path.

  2. options is additional options.

Additional options

Type of a curve options (TypeScript):

export type C3DViewCurveOptions = {
    group?: number
    colors?: {
        lines?: C3DViewRGB
    }
}
  1. group field defines to which group a curve belongs.

  2. colors is a group of values to change colors of a graphics object:

    • lines is a {r, g, b} value of wireframe color.

Note

If the lines color is not present, the default color ({r: 0, g: 0, b: 0}) is used.

New in version 1.8.0: Added the group property.

Example

Example of the command adding a new curve (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},
            },
        }
    ]
})