66import scriptcontext as sc # type: ignore
77
88from compas .geometry import Box
9- from compas .geometry import Circle
109from compas .geometry import Cone
1110from compas .geometry import Cylinder
1211from compas .geometry import Frame
13- from compas .geometry import Plane
1412from compas .geometry import Sphere
1513from compas .geometry import Torus
1614
1917
2018# from .geometry import plane_to_rhino
2119from .geometry import frame_to_rhino
22- from .geometry import plane_to_compas
2320from .geometry import plane_to_compas_frame
2421from .geometry import point_to_compas
2522from .geometry import point_to_rhino
26- from .geometry import vector_to_compas
2723
2824# =============================================================================
2925# To Rhino
@@ -253,8 +249,9 @@ def cone_to_compas(cone):
253249 :class:`compas.geometry.Cone`
254250
255251 """
256- plane = Plane (cone .BasePoint , vector_to_compas (cone .Plane .Normal ).inverted ())
257- return Cone (Circle (plane , cone .Radius ), cone .Height )
252+ frame = plane_to_compas_frame (cone .Plane )
253+ frame .point = point_to_compas (cone .BasePoint ) # invert the z-axis?
254+ return Cone (radius = cone .Radius , height = cone .Height , frame = frame )
258255
259256
260257def cylinder_to_compas (cylinder ):
@@ -269,10 +266,10 @@ def cylinder_to_compas(cylinder):
269266 :class:`compas.geometry.Cylinder`
270267
271268 """
272- plane = plane_to_compas (cylinder .BasePlane )
269+ frame = plane_to_compas_frame (cylinder .BasePlane )
273270 height = cylinder .TotalHeight
274- plane .point += plane .normal * (0.5 * height )
275- return Cylinder (Circle ( plane , cylinder .Radius ) , height )
271+ frame .point += frame .normal * (0.5 * height )
272+ return Cylinder (radius = cylinder .Radius , height = height , frame = frame )
276273
277274
278275def torus_to_compas (torus ):
0 commit comments