Class: DxfIO::Entity::Ellipse
- Inherits:
-
Other
- Object
- Other
- DxfIO::Entity::Ellipse
show all
- Defined in:
- lib/dxf_io/entity/ellipse.rb
Constant Summary
collapse
- ADDITIONAL_GROUP_CODES =
{minor_to_major_ration: 40}.freeze
Constants inherited
from Other
Other::END_POINT_GROUP_NUMS, Other::GROUP_CODES, Other::START_POINT_GROUP_NUMS, Other::TYPE_NAME_VALUE_MAPPING, Other::X_COORDINATE_GROUP_NUMS, Other::Y_COORDINATE_GROUP_NUMS, Other::Z_COORDINATE_GROUP_NUMS
Instance Method Summary
collapse
Methods inherited from Other
#-, #bordering_xs, #bordering_ys, #frame?, #height, #left_down_point, #move_to!, #points, #to_a, #to_h, #width, #xs, #ys
Instance Method Details
#bordering_points ⇒ Object
34
35
36
|
# File 'lib/dxf_io/entity/ellipse.rb', line 34
def bordering_points
major_axis_points + minor_axis_points
end
|
#center ⇒ Object
14
15
16
|
# File 'lib/dxf_io/entity/ellipse.rb', line 14
def center
points.find(&:start?)
end
|
#major_axis_endpoint_vector ⇒ Object
18
19
20
|
# File 'lib/dxf_io/entity/ellipse.rb', line 18
def major_axis_endpoint_vector
points.find(&:end?)
end
|
#major_axis_points ⇒ Object
26
27
28
|
# File 'lib/dxf_io/entity/ellipse.rb', line 26
def major_axis_points
[center + major_axis_endpoint_vector, center + major_axis_endpoint_vector.rotate_180]
end
|
#minor_axis_endpoint_vector ⇒ Object
22
23
24
|
# File 'lib/dxf_io/entity/ellipse.rb', line 22
def minor_axis_endpoint_vector
major_axis_endpoint_vector.rotate_90 * minor_to_major_ration
end
|
#minor_axis_points ⇒ Object
30
31
32
|
# File 'lib/dxf_io/entity/ellipse.rb', line 30
def minor_axis_points
[center + minor_axis_endpoint_vector, center + minor_axis_endpoint_vector.rotate_180]
end
|