Hello everyone,
I have used Brep.GetBoundingBox(Plane plane) before. However, when I use it on a brep created from a text entity, it fails me:
from Rhino import *
from Rhino.DocObjects import *
from Rhino.Geometry import *
doc = RhinoDoc.ActiveDoc
doc.Objects.Clear()
text = "T"
style = DimensionStyle()
plane = Plane(Point3d(-2.0, 0.0, 1.0), Point3d(-1.0, 1.0, 1.0), Point3d(-2.0, 0.0, 2.0))
entity = TextEntity.CreateWithRichText(text, plane, style, False, 10.0, 0.0)
brep = entity.CreatePolySurfaces(style, 0.5)[0]
bbox = Box(brep.GetBoundingBox(plane))
doc.Objects.AddBrep(brep)
doc.Objects.AddBox(bbox)
doc.Views.Redraw()
In the code above I create some text aligned to a plane in space. When I try to get the plane-aligned bounding box of this text, things go wrong. What I get in fact, is the bounding box of the text as if it were created in Plane.WorldXY. Here is an example picture:
I do not understand how I get this result. Am I missing something, or is it a bug?
Greeting from Berlin,
Thomas