File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 77
88"""
99
10+ from math import pi
11+
1012from atom .api import Typed
1113from OCCT .BRepBuilderAPI import BRepBuilderAPI_MakeFace , BRepBuilderAPI_MakeWire
1214from OCCT .Geom import Geom_Ellipse
@@ -25,9 +27,13 @@ class OccEllipse(OccEdge, ProxyEllipse):
2527
2628 def create_shape (self ):
2729 d = self .declaration
28- major = max (d .major_radius , d .minor_radius )
29- minor = min (d .major_radius , d .minor_radius )
30- curve = self .curve = Geom_Ellipse (coerce_axis (d .axis ), major , minor )
30+ r1 , r2 = d .major_radius , d .minor_radius
31+ axis = coerce_axis (d .axis )
32+ if r1 >= r2 :
33+ curve = Geom_Ellipse (axis , r1 , r2 )
34+ else :
35+ curve = Geom_Ellipse (axis , r2 , r1 ).Rotated (axis .Axis (), pi / 2 )
36+ self .curve = curve
3137 edge = self .make_edge (curve )
3238 if d .as_face :
3339 wire = BRepBuilderAPI_MakeWire (edge ).Wire ()
You can’t perform that action at this time.
0 commit comments