Class: ModraUp::Curve
- Inherits:
-
ModraUp::Entity
- Object
- ModraUp::Entity
- ModraUp::Curve
Overview
Curves on the edge. Circles/-arcs are a subclass ModraUp::ArcCurve. They are not ModraUp::Drawingelement.
Instance Method Summary # collapse
-
#vertices ⇒ Array<ModraUp::Vertex>
Returns the vertices of the curve in the order of curve edges, without repeating the starting point for closed curves.
-
#each_edge ⇒ nil, Enumerator
Iterate through each edge of the curve; returns an Enumerator if no block is passed.
-
#length ⇒ Length, Float
The length of a general curve is the sum of the lengths of its segments, while an arc length is calculated by multiplying the radius by the swept angle.
-
#is_polygon? ⇒ Boolean
Returns true if the curve is a polygon created by a polygon tool, add_ngon, or a conversion operation.
-
#move_vertices(points) ⇒ Boolean
Move all vertices of the curve, the number of vertices must match the input, preserving curve association for non-circular transformations.
-
#count_edges ⇒ Integer
The number of edges that compose the curve.
-
#edges ⇒ Array<ModraUp::Edge>
The edges that compose this curve.
-
#first_edge ⇒ ModraUp::Edge, nil
The first edge.
-
#last_edge ⇒ ModraUp::Edge, nil
The last edge.
-
#typename ⇒ String
Type Name ArcCurve.
-
#entityID ⇒ Integer
The curve entity ID within the current Sketchup session.
-
#persistent_id ⇒ Integer
Curve ID saved with the model, see ModraUp::Entity#persistent_id.
-
#parent ⇒ ModraUp::Model, ModraUp::ComponentDefinition
The owner in the drawing context.
-
#attribute_dictionaries ⇒ nil
Arc curves do not have attribute dictionaries.
-
#set_attribute(dict_name, key, value) ⇒ Object
Arc curves do not support attribute dictionaries.
Inherited from ModraUp::Entity
-
#add_observer(observer) ⇒ Boolean
Register a ModraUp::EntityObserver. Adding the same object a second time returns false. Locking, property, and material changes will dispatch an onChangeEntity event.
-
#remove_observer(observer) ⇒ Boolean
Remove the entity observer.
-
#model ⇒ ModraUp::Model
The model it belongs to.
-
#to_s ⇒ String
String form. Returns "#<Deleted Entity>” when the entity has been deleted.
-
#inspect ⇒ String
Same as #to_s.
-
#attribute_dictionary(name) ⇒ ModraUp::AttributeDictionary, nil
Retrieve an attribute dictionary by name. If none exists, return nil; if create is true, create an empty dictionary. ModraUp::Loop / ModraUp::EdgeUse / ModraUp::Curve always return nil.
-
#valid? ⇒ Boolean
Returns true if the entity is valid, meaning it has not been deleted from the model. Revoked entities are false; even if new geometry is drawn occupying its original position, this object remains an invalid entity (still false). Repeating the action to restore it makes it valid again.
-
#deleted? ⇒ Boolean
Opposite of #valid?.
-
#get_attribute(dict_name, key, default = nil) ⇒ Object
Read the attribute. If dict_name and key are Symbols, convert them to strings (similar to SketchUp). If the dictionary or key does not exist, return default. The return value type is the same as what is written by #set_attribute.
-
#delete_attribute(dict_name) ⇒ Boolean
Delete a key, or delete the entire dictionary when the key is omitted.
Instance Method Details
curve.vertices ⇒ Array<ModraUp::Vertex>
Returns the vertices of the curve in the order of curve edges, without repeating the starting point for closed curves.
curve.each_edge { |edge| ... } ⇒ nil
Iterate through each edge of the curve; returns an Enumerator if no block is passed.
curve.length ⇒ Length or Float
The length of a general curve is the sum of the lengths of its segments, while an arc length is calculated by multiplying the radius by the swept angle.
curve.is_polygon? ⇒ Boolean
Returns true if the curve is a polygon created by a polygon tool, add_ngon, or a conversion operation.
curve.move_vertices(points) ⇒ Boolean
Move all vertices of the curve, the number of vertices must match the input, preserving curve association for non-circular transformations.
curve.count_edges ⇒ Integer
The number of edges that compose the curve.
curve.edges ⇒ Array<ModraUp::Edge>
The edges that compose this curve.
curve.first_edge ⇒ ModraUp::Edge, nil
The first edge.
curve.last_edge ⇒ ModraUp::Edge, nil
The last edge.
curve.typename ⇒ String
Type Name ArcCurve.
curve.entityID ⇒ Integer
The curve entity ID within the current Sketchup session.
curve.persistent_id ⇒ Integer
Curve ID saved with the model, see ModraUp::Entity#persistent_id.
curve.parent ⇒ ModraUp::Model, ModraUp::ComponentDefinition
The owner in the drawing context.
curve.attribute_dictionaries ⇒ nil
Arc curves do not have attribute dictionaries.
curve.set_attribute(dict_name, key, value) ⇒ value
Arc curves do not support attribute dictionaries.