ModraUp Ruby API Documentation Ruby API Reference

Class: ModraUp::ArcCurve

Inherits:
ModraUp::Curve show all

Overview

Arcs or arcs (pline edge chain). Obtain using ModraUp::Edge#curve. The parent class is ModraUp::Curve.

Examples:

edges = ModraUp.active_model.entities.add_circle([0, 0, 0], [0, 0, 1], 5, 12)
edges[0].curve.count_edges  #=> 12

Instance Method Summary # collapse

Inherited from ModraUp::Curve

Inherited from ModraUp::Entity

Instance Method Details

curve.plane ⇒ Array<Float>

The four coefficients [A, B, C, D] of the plane containing the arc.

Returns:

  • (Array<Float>)

curve.num_segments ⇒ Integer

Number of Segments (for arcs and circles in the entity).

Returns:

  • (Integer)
Note: ModraUp extension. SketchUp's official API does not provide read-write access to the number of segments; modifying the number of segments is handled by model operators.

Examples:

ModraUp.active_model.entities.add_circle([0, 0, 0], [0, 0, 1], 5, 12)[0].curve.num_segments

curve.num_segments=(count) ⇒ Integer

Modify the number of segments while keeping the center/radius/angle. Use the ModraUp::Model transaction operator.

Parameters:

  • count (Integer)

Returns:

  • (Integer)

Raises:

  • [ArgumentError] Cannot change segments (curve has been deleted or modified).
Note: ModraUp extension.

Examples:

c = ModraUp.active_model.entities.add_circle([0, 0, 0], [0, 0, 1], 5, 12)[0].curve
c.num_segments = 24

curve.center ⇒ Geom::Point3d

Center.

Returns:

  • (Geom::Point3d)

Examples:

ModraUp.active_model.entities.add_circle([0, 0, 0], [0, 0, 1], 5)[0].curve.center

curve.radius ⇒ Float

Radius (in inches).

Returns:

  • (Float)

Examples:

ModraUp.active_model.entities.add_circle([0, 0, 0], [0, 0, 1], 5)[0].curve.radius

curve.circular? ⇒ Boolean

Returns whether the arc curve is a closed circle.

Returns:

  • (Boolean)

Examples:

ModraUp.active_model.entities.add_circle([0, 0, 0], [0, 0, 1], 5)[0].curve.circular?

curve.start_angle ⇒ Float

Start angle (radians).

Returns:

  • (Float)

Examples:

ModraUp.active_model.entities.add_circle([0, 0, 0], [0, 0, 1], 5)[0].curve.start_angle

curve.end_angle ⇒ Float

Terminates angle (radians).

Returns:

  • (Float)

Examples:

ModraUp.active_model.entities.add_circle([0, 0, 0], [0, 0, 1], 5)[0].curve.end_angle

curve.normal ⇒ Geom::Vector3d

Arc plane normal.

Returns:

  • (Geom::Vector3d)

Examples:

ModraUp.active_model.entities.add_circle([0, 0, 0], [0, 0, 1], 5)[0].curve.normal

curve.xaxis ⇒ Geom::Vector3d

Arc coordinate system X-axis. Length equals the radius.

Returns:

  • (Geom::Vector3d)

Examples:

ModraUp.active_model.entities.add_circle([0, 0, 0], [0, 0, 1], 5)[0].curve.xaxis

curve.yaxis ⇒ Geom::Vector3d

Arc coordinate system Y-axis. Length equals the radius.

Returns:

  • (Geom::Vector3d)

Examples:

ModraUp.active_model.entities.add_circle([0, 0, 0], [0, 0, 1], 5)[0].curve.yaxis