I am not able to get my center point to the center of the bounding box.
avX = mt.fsum([(pnt.X) for pnt in list])/len(list)
Really?! Can you tell me how in python?
import rhinoscriptsyntax as rs import Rhino.Geometry as rg import math as mt list = rs.BoundingBox(x) #avX = mt.fsum([(pnt.X) for pnt in list])/len(list) #avY = mt.fsum([(pnt.Y) for pnt in list])/len(list) #avZ = mt.fsum([(pnt.Z) for pnt in list])/len(list) center = rs.BoundingBox.Center(rs.AddBox(list))
Is it possible in python?
Thank you, you answered my question.
Do you know how to make from a BB a Brep?
You can call this method on the BB variable:
Thank you, I tried to implement that one, but I do not understand it (this is my first time using Rhinoceros code instead of rhinoscriptsyntax). (I found it earlier on, but did not know how.)
20180915 00 problem bbox to brep.gh (5.9 KB)
There’s a lot of stuff going on there you do not need (the
scriptcontext.doc bits etc). If you set your input typehints appropriately, you can simply call properties/methods on RhinoCommon objects directly like so:
I also called the
Inflate method on the bounding box here, as a simpler alternative to scaling it (from your other thread on this topic).
I would suggest maybe going through some GHPython basics before going much further: