MotorXP-AFM Scripting API
    Preparing search index...

    Interface Shape

    Shape type

    interface Shape {
        area(): number;
        back(dy: number): Shape;
        center(): Point3;
        diff(other: Shape): Shape;
        diff(other: Shape): Shape;
        difference(other: Shape): Shape;
        difference(other: Shape): Shape;
        distance(other: Shape): number;
        down(dz: number): Shape;
        edges(): Shape[];
        edges(): Shape[];
        extrema(other: Shape): Shape;
        extrude(z: number): Shape;
        extrude(x: number, y: number, z: number): Shape;
        extrude(V: Vector3): Shape;
        extrudeX(x: number): Shape;
        extrudeY(y: number): Shape;
        extrudeZ(z: number): Shape;
        fill(): Shape;
        firstParameter(): number;
        firstPoint(): Point3;
        forw(dy: number): Shape;
        interpolate(countPoint: number): Point3[];
        intersect(other: Shape): Shape;
        isEmpty(): boolean;
        lastParameter(): number;
        lastPoint(): Point3;
        left(dx: number): Shape;
        length(): number;
        length(): number;
        mirrorO(): Shape;
        mirrorX(): Shape;
        mirrorXY(): Shape;
        mirrorXZ(): Shape;
        mirrorY(): Shape;
        mirrorYZ(): Shape;
        mirrorZ(): Shape;
        move(dx: number, dy: number, dz: number): Shape;
        move(v: Vector3 | Point3): Shape;
        moveX(dx: number): Shape;
        moveY(dy: number): Shape;
        moveZ(dz: number): Shape;
        nearEdge(pt: Point3): Shape;
        nearFace(pt: Point3): Shape;
        nearVertex(pt: Point3): Shape;
        pointAt(parameter: number): Point3;
        points(all?: boolean): Point3[];
        right(dx: number): Shape;
        rotate(angle: number, axis: Vector3): Shape;
        rotate(x: number, y: number, z: number): Shape;
        rotateX(angle: number, center?: Point3): Shape;
        rotateY(angle: number, center?: Point3): Shape;
        rotateZ(angle: number, center?: Point3): Shape;
        scale(factor: number, center: Point3): Shape;
        toFileSTEP(path: string): boolean;
        translate(dx: number, dy: number, dz: number): Shape;
        translate(v: Vector3): Shape;
        translateX(dx: number): Shape;
        translateY(dy: number): Shape;
        translateZ(dz: number): Shape;
        unify(): Shape;
        unite(other: Shape): Shape;
        up(dz: number): Shape;
        vertices(all?: boolean): Point3[];
        volume(): number;
        wire(): Shape;
    }
    Index
    • Returns the shape area.

      Returns number

      Surface area of the shape.

    • Parameters

      • dy: number

      Returns Shape

    • Returns the geometric center of the shape.

      Returns Point3

      Shape center in 3D coordinates.

    • Subtracts another shape from this one.

      Parameters

      • other: Shape

        {Shape} Shape to subtract.

      Returns Shape

      Shape resulting from the difference.

    • Alias for difference.

      Parameters

      • other: Shape

        {Shape} The other shape.

      Returns Shape

      New shape after subtraction.

    • Alias for diff: difference of shapes.

      Parameters

      • other: Shape

        {Shape} Shape to subtract.

      Returns Shape

      Resulting shape.

    • Subtracts another shape from this one.

      Parameters

      • other: Shape

        {Shape} The other shape.

      Returns Shape

      New shape after subtraction.

    • Calculates the distance to another shape.

      Parameters

      • other: Shape

        {Shape} Shape to measure the distance to.

      Returns number

      Minimum distance between shapes.

    • Parameters

      • dz: number

      Returns Shape

    • Returns the edges of the current geometric shape.

      Returns Shape[]

      Array of Shape objects representing the edges.

    • Returns the edges of the shape.

      Returns Shape[]

      Array of Shape objects representing edges.

    • Returns the extreme points of the shape.

      Parameters

      • other: Shape

        {Shape} Shape for calculating extrema.

      Returns Shape

      Shape containing the extreme points.

    • Extrudes the shape along Z.

      Parameters

      • z: number

        {number} Extrusion distance along Z.

      Returns Shape

      Extrusion result.

    • Extrudes the shape.

      Parameters

      • x: number

        {number} Extrusion distance along X.

      • y: number

        {number} Extrusion distance along Y.

      • z: number

        {number} Extrusion distance along Z.

      Returns Shape

      Extrusion result.

    • Extrudes the shape.

      Parameters

      • V: Vector3

        {Vector3} Extrusion vector.

      Returns Shape

      Extrusion result.

    • Extrudes along X.

      Parameters

      • x: number

        {number} Distance along X.

      Returns Shape

      Resulting shape.

    • Extrudes along Y.

      Parameters

      • y: number

        {number} Distance along Y.

      Returns Shape

      Resulting shape.

    • Extrudes along Z.

      Parameters

      • z: number

        {number} Distance along Z.

      Returns Shape

      Resulting shape.

    • Fills the shape by creating a surface or solid from its boundary.

      Returns Shape

      Resulting shape.

    • Returns the first curve parameter.

      Returns number

      First parameter.

    • Returns the first point on the curve.

      Returns Point3

      First point on the curve.

    • Parameters

      • dy: number

      Returns Shape

    • Interpolates points along the curve, returning the specified number of points.

      Parameters

      • countPoint: number

        {number} Number of interpolation points. If 0, the optimal number is determined automatically.

      Returns Point3[]

      Array of interpolated points.

    • Intersects with another shape.

      Parameters

      • other: Shape

        {Shape} The other shape.

      Returns Shape

      Intersection result.

    • Checks whether the shape is empty.

      Returns boolean

      True if the shape is empty.

    • Returns the last parameter of the curve or wire.

      Returns number

      Last parameter.

    • Returns the last point on the curve.

      Returns Point3

      Last point on the curve.

    • Parameters

      • dx: number

      Returns Shape

    • Returns the curve length or shape perimeter.

      Returns number

      Length.

    • Returns the length of the shape.

      Returns number

      Shape length.

    • Reflects about the origin.

      Returns Shape

      Reflected shape.

    • Reflects about the X axis.

      Returns Shape

      Reflected shape.

    • Reflects about the XY plane.

      Returns Shape

      Reflected shape.

    • Reflects about the XZ plane.

      Returns Shape

      Reflected shape.

    • Reflects about the Y axis.

      Returns Shape

      Reflected shape.

    • Reflects about the YZ plane.

      Returns Shape

      Reflected shape.

    • Reflects about the Z axis.

      Returns Shape

      Reflected shape.

    • Convenience aliases for translate (move).

      Parameters

      • dx: number
      • dy: number
      • dz: number

      Returns Shape

    • Parameters

      Returns Shape

    • Parameters

      • dx: number

      Returns Shape

    • Parameters

      • dy: number

      Returns Shape

    • Parameters

      • dz: number

      Returns Shape

    • Finds the edge nearest to a given point.

      Parameters

      • pt: Point3

        {Point3} Point used to find the nearest edge.

      Returns Shape

      Shape representing the nearest edge.

    • Finds the face nearest to a given point.

      Parameters

      • pt: Point3

        {Point3} Point used to find the nearest face.

      Returns Shape

      Shape representing the nearest face.

    • Finds the vertex nearest to a given point.

      Parameters

      • pt: Point3

        {Point3} Point used to find the nearest vertex.

      Returns Shape

      Shape representing the nearest vertex.

    • Returns the point on the curve at a given parameter.

      Parameters

      • parameter: number

        {number} Parameter at which to find the point.

      Returns Point3

      Point on the curve.

    • Returns the points (vertices) of the shape; same as vertices().

      Parameters

      • Optionalall: boolean

        {boolean} If true, returns all points; otherwise only unique points [default=false].

      Returns Point3[]

      Array of points.

    • Parameters

      • dx: number

      Returns Shape

    • Rotates about an arbitrary vector.

      Parameters

      • angle: number

        {number} Rotation angle in degrees.

      • axis: Vector3

        {Vector3} Rotation axis vector.

      Returns Shape

      New shape after rotation.

    • Rotates about X, Y, and Z.

      Parameters

      • x: number

        {number} Angle about X in degrees.

      • y: number

        {number} Angle about Y in degrees.

      • z: number

        {number} Angle about Z in degrees.

      Returns Shape

      New shape after rotation.

    • Rotates about X.

      Parameters

      • angle: number

        {number} Angle in degrees.

      • Optionalcenter: Point3

        {Point3} Rotation center [default=(0,0,0)].

      Returns Shape

      New shape after rotation.

    • Rotates about Y.

      Parameters

      • angle: number

        {number} Angle in degrees.

      • Optionalcenter: Point3

        {Point3} Rotation center [default=(0,0,0)].

      Returns Shape

      New shape after rotation.

    • Rotates about Z.

      Parameters

      • angle: number

        {number} Angle in degrees.

      • Optionalcenter: Point3

        {Point3} Rotation center [default=(0,0,0)].

      Returns Shape

      New shape after rotation.

    • Scales the shape about a center.

      Parameters

      • factor: number

        {number} Scale factor.

      • center: Point3

        {Point3} Scaling center.

      Returns Shape

      New shape after scaling.

    • Saves the shape to a STEP file.

      Parameters

      • path: string

        {string} File path.

      Returns boolean

      True if the file was written.

    • Translates the shape by the specified X, Y, and Z displacements.

      Parameters

      • dx: number

        {number} Displacement along X.

      • dy: number

        {number} Displacement along Y.

      • dz: number

        {number} Displacement along Z.

      Returns Shape

      New shape after translation.

    • Translates the shape by a vector.

      Parameters

      • v: Vector3

        {Vector3} Translation vector.

      Returns Shape

      New shape after translation.

    • Translates the shape along X only.

      Parameters

      • dx: number

        {number} Displacement along X.

      Returns Shape

      New shape.

    • Translates the shape along Y only.

      Parameters

      • dy: number

        {number} Displacement along Y.

      Returns Shape

      New shape.

    • Translates the shape along Z only.

      Parameters

      • dz: number

        {number} Displacement along Z.

      Returns Shape

      New shape.

    • Combines all separate parts of the shape into a single whole.

      Returns Shape

      New combined shape.

    • Unites the current shape with another shape.

      Parameters

      • other: Shape

        {Shape} The other shape.

      Returns Shape

      New shape after union.

    • Shorthand translation methods.

      Parameters

      • dz: number

      Returns Shape

    • Returns the vertices of the shape.

      Parameters

      • Optionalall: boolean

        {boolean} If true, returns all points; otherwise only unique points [default=false].

      Returns Point3[]

      Array of points.

    • Returns the shape volume.

      Returns number

      Shape volume.

    • Converts the shape to its wireframe.

      Returns Shape

      Shape wireframe.