Closed ZacZhangzhuo closed 1 year ago
Hi @ZacZhangzhuo, thanks for opening this issue!
Yes. It's actually compas.geometry.Plane
that's only defined using a point and a z-normal vector, so when converting a Rhino.Geometry.Plane
this information is indeed lost. Instead you could use compas.geometry.Frame
which is defined using a point and two vectors, see in docs.
You can then convert to and from Rhino.Geometry.Plane
using plane_to_compas_frame
and frame_to_rhino_plane
correspondingly. So slightly adapting your code, this would look like this:
import Rhino.Geometry as rg
from compas_rhino.conversions import plane_to_compas_frame
from compas_rhino.conversions import frame_to_rhino_plane
plane = rg.Plane(rg.Point3d(-99.0,-187.5,117.9),rg.Vector3d(-0.7,0.6,0),rg.Vector3d(-0.1,-0.1,0.9))
plane = frame_to_rhino_plane(plane_to_compas_frame(plane)) # comment or uncomment this line, the plane should now be the same as the original
Note: frame_to_rhino_plane
is still unreleased, so to use it you would need to install COMPAS directly from GitHub. If you prefer not to it is quite simple to implement it your own. Check it out here.
Thank you so much!
Describe the bug When using
plane_to_rhino
andplane_to_compas
, the conversion is not correct. My guess is that Rhino only records Origin and Normal for describing a plane, which is not comprehensive.Here is an example to of the bug: