Welcome to AR-327 !!
Today's learning objectives:
- Understand the basics of Boolean operations
- Learn to use it on basic Rhino geometries
Boolean Operations
Boolean Operations
How would you realise such geometries in Rhino (manually) ?
Boolean Operations
In theory 3 boolean operators exist: And, Or, Not
Boolean Operations
Rhino defines 4 operations:
- Intersection(And)
- Union (Or)
- Difference (Not)
- Split (Not & And)
Boolean Operations
A small word about tolerances:
We deal with geometries with intersections: tolerances are very important!
TOL = Rhino.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance
Boolean Operations
A small word about brep orientation:
Breps have an orientation, that is important for boolean operations:
# Making sure that `my_brep` is ready for boolean operation:
orientation = my_brep.SolidOrientation
if orientation == Rhino.Geometry.BrepSolidOrientation.Inwards:
my_brep.Flip()
Boolean Union
A Boolean union will combine multiple objects into fewer objects that don't intersect:
Boolean Union
And in code ?
TOL = Rhino.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance
breps = [brep1, brep2, brep3, brep4]
unions = Rhino.Geometry.Brep.CreateBooleanUnion(breps, TOL)
Boolean Union
And in code ?
TOL = Rhino.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance
breps = [brep1, brep2, brep3, brep4]
unions = Rhino.Geometry.Brep.CreateBooleanUnion(breps, TOL)
What will be the type of `unions` ?
Exercice on Boolean union (20 min)
In the website, go to the boolean union page and solve the third exercice (02). You will need the .3dm as well
Boolean Difference
A boolean difference substracts from a volume all the space that also belongs to another volume
Boolean Difference
And in code ?
TOL = Rhino.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance
first_list = [brep_1, brep_2]
second_list = [brep_a, brep_b]
differences = Rhino.Geometry.Brep.CreateBooleanDifference(first_list,
second_list,
TOL)
Exercice on Boolean difference (20 min)
In the website, go to the boolean difference page and solve the first exercice (01). You will need the .3dm as well
Boolean Intersection
A boolean intersection keeps the volume that belongs to elements of both sets of volumes:
Boolean Intersection
And in code ?
TOL = Rhino.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance
first_list = [brep_1, brep_2]
second_list = [brep_a, brep_b]
intersections = Rhino.Geometry.Brep.CreateBooleanIntersection(first_list,
second_list,
TOL)
Boolean Split
A boolean split performs an intersection and a difference in parallel and returns both results:
Boolean Split
And in code ?
TOL = Rhino.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance
first_list = [brep_1, brep_2]
second_list = [brep_a, brep_b]
splits = Rhino.Geometry.Brep.CreateBooleanSplit(first_list,
second_list,
TOL)
Exercice on Boolean difference (yes, another one) (20 min)
In the website, go to the boolean difference page and solve the second exercice (02). You will need the .3dm as well
Assignment (last one!)
Deadline: 21st of may