Class: Layout::RadialDimension
- Inherits:
-
Layout::Entity
- Object
- Layout::Entity
- Layout::RadialDimension
Overview
Radial dimensions for arcs or circles: The dimension line passes through the center of the circle or arc and points to the text, with a prefix of R for radius or Ø for diameter.
Class Method Summary # collapse
-
.new(center_point, circle_point, text_point = nil, diameter = false) ⇒ Layout::RadialDimension
Create a radial (or diameter) dimension. The radius is the distance from the circle_point to the center; the dimension line points towards the text_point (defaults to circle_point), with the number placed at text_point not overlapping the arrow.
Instance Method Summary # collapse
-
#center_point ⇒ Geom::Point2d
Center.
-
#circle_point ⇒ Geom::Point2d
The intersection point of the dimension line with the circle (at the arrow).
-
#text_point ⇒ Geom::Point2d
Position of the text point.
-
#text_point= ⇒ Geom::Point2d
Move the digit one step at a time; the dimension line rotates around the center while the radius remains unchanged (similar to dragging within the interface).
-
#radius ⇒ Length
Radial dimension on the plane (independent of #diameter?).
-
#diameter? ⇒ Boolean
Indicates whether the dimension is a diameter.
-
#diameter= ⇒ Boolean
Switch between radius and diameter in one step. Undo the change.
-
#text ⇒ Layout::FormattedText
Display the copied text (e.g., R25).
-
#text= ⇒ Layout::FormattedText, String
Customize the text, <> represents prefixed numerical values, and perform one step of undo.
-
#custom_text? ⇒ Boolean
Whether to use custom text.
-
#custom_text= ⇒ Boolean
Set false to restore the display of the measurement value.
-
#scale ⇒ Float
Scale factor (ratio), same as Layout::LinearDimension#scale.
-
#scale= ⇒ Numeric
Set the scale factor for the radial dimension, and perform an undo step.
-
#precision ⇒ Integer
Decimal places; -1 follows the model's setting.
-
#precision= ⇒ Integer
Set the decimal precision, with one step in undo.
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::RadialDimension.new(center_point, circle_point, text_point = nil, diameter = false) ⇒ Layout::RadialDimension
Create a radial (or diameter) dimension. The radius is the distance from the circle_point to the center; the dimension line points towards the text_point (defaults to circle_point), with the number placed at text_point not overlapping the arrow.
Instance Method Details
dimension.center_point ⇒ Geom::Point2d
Center.
dimension.circle_point ⇒ Geom::Point2d
The intersection point of the dimension line with the circle (at the arrow).
dimension.text_point ⇒ Geom::Point2d
Position of the text point.
dimension.text_point = point
Move the digit one step at a time; the dimension line rotates around the center while the radius remains unchanged (similar to dragging within the interface).
dimension.radius ⇒ Length
Radial dimension on the plane (independent of #diameter?).
dimension.diameter? ⇒ Boolean
Indicates whether the dimension is a diameter.
dimension.diameter = diameter
Switch between radius and diameter in one step. Undo the change.
dimension.text ⇒ Layout::FormattedText
Display the copied text (e.g., R25).
dimension.text = formatted_text
Customize the text, <> represents prefixed numerical values, and perform one step of undo.
dimension.custom_text? ⇒ Boolean
Whether to use custom text.
dimension.custom_text = custom
Set false to restore the display of the measurement value.
dimension.scale ⇒ Float
Scale factor (ratio), same as Layout::LinearDimension#scale.
dimension.scale = ratio
Set the scale factor for the radial dimension, and perform an undo step.
dimension.precision ⇒ Integer
Decimal places; -1 follows the model's setting.
dimension.precision = digits
Set the decimal precision, with one step in undo.