Class: Layout::AngularDimension
- Inherits:
-
Layout::Entity
- Object
- Layout::Entity
- Layout::AngularDimension
Overview
Angle Dimension: The angle between two edges, with the arc of the dimension centered at the intersection of the two dimension lines. The connection points are on the edges being measured, and the extension points are at the ends of the arc. The value is the paper angle (in degrees), with the text, endpoints, and height sharing the same naming style as other dimensions.
end_offset_length=2 mm (the dimension line is fixed 2 mm away from the measured point); cannot connect (as in LayOut), instead, it is only associated when using the angle dimension tool to mark viewport model lines on the drawing sheet.
Class Method Summary # collapse
-
.new(start_point, end_point, start_extent_point, end_extent_point, inner_angle) ⇒ Layout::AngularDimension
Create an angular dimension. The start_point and end_point are points on the measured edges, while the start_extent_point and end_extent_point are the endpoints of the dimension arc. The intersection of the two dimension lines (from the measured points to the extent points) is the center of the dimension arc, and the radius is the distance from the center to the start_extent_point.
Instance Method Summary # collapse
-
#angle ⇒ Float
The angle measured in radians.
-
#radius ⇒ Length
The distance from the center to the dimension arc.
-
#radius= ⇒ Length, Numeric
Modify the dimension arc radius, one step undo; the measured point and the center remain unchanged.
-
#arc_center_point ⇒ Geom::Point2d
The arc center point (the intersection of two edge lines).
-
#start_connection_point ⇒ Geom::Point2d
The measurement point on the first edge.
-
#start_connection_point= ⇒ Geom::Point2d
Move the measurement point on the first edge one step back; recalculate the dimension center based on the dimension line.
-
#end_connection_point ⇒ Geom::Point2d
The measured point on the second edge.
-
#end_connection_point= ⇒ Geom::Point2d
Move the measurement point on the second edge, one step undo.
-
#start_extent_point ⇒ Geom::Point2d
The start of the dimension arc.
-
#start_extent_point= ⇒ Geom::Point2d
Move the start extent point of the angular dimension arc, one step in undo; the radius changes accordingly with the measured angle.
-
#end_extent_point ⇒ Geom::Point2d
The end of the dimension arc.
-
#end_extent_point= ⇒ Geom::Point2d
Move the end extent point of the angular dimension arc, one step undo.
-
#start_offset_point ⇒ Geom::Point2d
The starting point of the first dimension line; when the dimension arc falls on an edge and no dimension line is drawn, it equals #start_extent_point.
-
#end_offset_point ⇒ Geom::Point2d
The starting point of the second dimension line.
-
#text ⇒ Layout::FormattedText
Displays the text copy (degrees, such as +45°) centered on the dimension.
-
#text= ⇒ Layout::FormattedText, String
Customize the text (use its plain text), where <> represents the angle, and this step is undoable.
-
#custom_text? ⇒ Boolean
Whether to use custom text.
-
#custom_text= ⇒ Boolean
Pass false to restore the display of the angle.
Inherited from Layout::Entity
-
#bounds ⇒ Geom::Bounds2d
The bounding box after rotation, in paper inches.
-
#untransformed_bounds ⇒ Geom::Bounds2d
Unrotated bounds (x, y, width, height), paper inches.
-
#untransformed_bounds= ⇒ Geom::Bounds2d
Modify position and size, with one undo step. The rules are the same as for the layout: the view preserves scale on resize (default) when Layout::SketchUpModel#preserve_scale_on_resize? is true, otherwise it scales by height only; dimensions and leaders only move and do not scale. If they extend beyond the paper edge, they are clipped back within the paper.
-
#style ⇒ Layout::Style
A copy of the current style. Modifying the copy does not affect the object; use #style= to apply the changes.
-
#style= ⇒ Layout::Style
Apply the style, undoing one step. Only apply properties relevant to the object type (e.g., text ignoring line type).
-
#page ⇒ Layout::Page, nil
The current page; objects on shared layers or those not yet added to the document are nil.
-
#document ⇒ Layout::Document, nil
Belongs to a Layout::Entity document; is nil if not added yet.
-
#on_shared_layer? ⇒ Boolean
Returns true if the entity is on a shared layer.
-
#layer_instance ⇒ Layout::LayerInstance, nil
The layer it resides on; nil if not added yet.
-
#move_to_layer(layer, pages = nil) ⇒ Layout::Entity
Move to another layer, one undo step. Objects on a shared layer remain on their associated page when moved to a regular layer.
-
#rotation ⇒ Float
Rotation angle around the bounding box center (degrees).
-
#rotation= ⇒ Numeric
Rotate around the bounding box center, one step in undo. Dimensions and leaders do not accept rotation (they follow their endpoints).
-
#get_attribute(dictionary, key, default = nil) ⇒ Object
Read plugin data on the object. Plugins can use this to identify objects they generate, such as re-creating automatic leader and dimension annotations.
-
#set_attribute(dictionary, key, value) ⇒ Object
Save plugin data on the object with a single undo step. Values can only be types that JSON can represent (nil, true, false, numbers, strings, Array, Hash), and a single object should not exceed 64 KB.
-
#delete_attribute(dictionary) ⇒ Boolean
Delete a key or an entire dictionary.
-
#attribute_dictionary(name, create = false) ⇒ Hash, nil
A copy of a dictionary.
-
#locked? ⇒ Object
Unsupported: OpenSu does not support object-level locking (please lock the layer).
-
#locked= ⇒ Object
Unsupported: OpenSu does not support object-level locking (please lock the layer).
-
#transform!(transformation) ⇒ Object
Unsupported: OpenSu does not support Geom::Transformation2d. For translation, use #untransformed_bounds=, and for rotation, use #rotation=.
-
#group ⇒ Object
Does not support: OpenSu drawings cannot be grouped.
-
#== ⇒ Boolean
Returns whether the two references identify the same drawing entity.
-
#eql?(other) ⇒ Boolean
Like #==, used as a key in a Hash.
-
#hash ⇒ Integer
Hash value consistent with #eql?.
-
#inspect ⇒ String
A brief description.
Class Method Details
Layout::AngularDimension.new(start_point, end_point, start_extent_point, end_extent_point, inner_angle) ⇒ Layout::AngularDimension
Create an angular dimension. The start_point and end_point are points on the measured edges, while the start_extent_point and end_extent_point are the endpoints of the dimension arc. The intersection of the two dimension lines (from the measured points to the extent points) is the center of the dimension arc, and the radius is the distance from the center to the start_extent_point.
Instance Method Details
dimension.angle ⇒ Float
The angle measured in radians.
dimension.radius ⇒ Length
The distance from the center to the dimension arc.
dimension.radius = radius
Modify the dimension arc radius, one step undo; the measured point and the center remain unchanged.
dimension.arc_center_point ⇒ Geom::Point2d
The arc center point (the intersection of two edge lines).
dimension.start_connection_point ⇒ Geom::Point2d
The measurement point on the first edge.
dimension.start_connection_point = point
Move the measurement point on the first edge one step back; recalculate the dimension center based on the dimension line.
dimension.end_connection_point ⇒ Geom::Point2d
The measured point on the second edge.
dimension.end_connection_point = point
Move the measurement point on the second edge, one step undo.
dimension.start_extent_point ⇒ Geom::Point2d
The start of the dimension arc.
dimension.start_extent_point = point
Move the start extent point of the angular dimension arc, one step in undo; the radius changes accordingly with the measured angle.
dimension.end_extent_point ⇒ Geom::Point2d
The end of the dimension arc.
dimension.end_extent_point = point
Move the end extent point of the angular dimension arc, one step undo.
dimension.start_offset_point ⇒ Geom::Point2d
The starting point of the first dimension line; when the dimension arc falls on an edge and no dimension line is drawn, it equals #start_extent_point.
dimension.end_offset_point ⇒ Geom::Point2d
The starting point of the second dimension line.
dimension.text ⇒ Layout::FormattedText
Displays the text copy (degrees, such as +45°) centered on the dimension.
dimension.text = formatted_text
Customize the text (use its plain text), where <> represents the angle, and this step is undoable.
dimension.custom_text? ⇒ Boolean
Whether to use custom text.
dimension.custom_text = custom
Pass false to restore the display of the angle.