Hi
I have a list of UnTrimmed Surfaces which are a part of a Pyramid Geometry, I want to extract the intersections for all of the surfaces and trim all the extra parts except “Solid Difference” parts.
in another way, at the end I want to have Some surfaces like the picture below:
I know in Rhino, I can Use the “Intersect” Command simply and trim or split the surfaces with the curves extracted from that command. But in ghpython in Grasshopper, I can’t figure it out!
I wrote some script for that but the output is null and I don’t know whats wrong with it. I wonder if someone can solve the issue.
thanks.
I’m not sure if I’m doing this right but I’ve managed to write this code on python:
Trim Brep.gh (13.8 KB)
now the problem is that I want the Other part of the Brep in the output of my code but instead, I Get another(Green part of the surface in picture below)!
import rhinoscriptsyntax as rs
import Rhino.Geometry as rg
import Rhino
tol = Rhino.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance
a = []
for i in x:
for j in x:
if j == i: continue
trmd = i.Trim(j, tol)
if trmd!=None and len(trmd)>0:
i = trmd[0]
a.append(i)
intersections = a
Its just taking the same tolerance settings as the Active Document. You could manually set it to 0.01 ( as you had in your original script), if you like.
thank you.
I wan wondering if there is a way to convert these Breps to Meshes Before Trimming them. Because it’s very optimized.
I tried the “Mesh Difference” component in grasshopper, But it keeps some extra part of mesh instead of deleting it!
Do you know how to fix it?
Anyway I’ll prepare later on a full demo on that matter: get a BrepFace collection and do any possible thing (Trim, Split, Diff, Intersection etc etc). That said it’s not clear what are you after: i.e. what exactly you want to achive from these cones? Do a joined something from the resulting BrepFaces collection? Thicken the BrepFaces (that’s a bit tricky)? Something else?
Other than that - obviously - you can get a Mesh from any valid and manifold Brep (well … in most of cases) - but occasionally Mesh ops work when they work.
Note: you can’t auto translate C# to P (meaning that you should rewrite the demo).
Note: always do a connectivity Tree in similar cases (what is involved with what)
Here I made a slightly faster version of @Adam_M code which is using parallel module:
from ghpythonlib import parallel
def trim_with_all(a):
for b in breps:
if b == a: continue
trimmed = a.Trim(b, 0.01)
if trimmed != None and len(trimmed) > 0:
a = trimmed[0]
return a
result = parallel.run(trim_with_all, breps)
The last script using Brep.CreateBooleanUnion:
from Rhino.Geometry import Brep
result = Brep.CreateBooleanUnion(breps, 0.01)
thank you for your time and guidance.
I mean in a rhino grasshopper environment, Trimming the Meshesh takes less time while the computer calculates the process than Trimming the Nurbs objects.
I want to have a 3D pattern created from intersected Cones with or without thickness, I rather we can add thickness calculation and even the finger-joint or any other joint for the Unrolled surfaces which have adjacency for manufacturing purposes later.
That’s why you should do/use a connectivity/adjacency (aka ccx relations so to speak) Tree (as shown: the left output (labeled conn) in the pics below).
BTW: A clear sketch related with your final goal could be helpfull.
BTW: Mesh/Mesh ops are not working always (but they are indeed faster). On the other hand if your core conic module is the same AND your collection follows some kind of grid … well … you should calculate the variants (middle, side perimetric etc etc) ONCE and then use them as Instance Definitions etc etc (that’s 1++M times faster).
Anyway: if we skip the thicken part for the moment (conic BrepFaces in pic1) is this 3 option output what you need?
BTW: One way to do some realistic thingy is to do your solids (pic2) , convert the “connectors” (pic3) to solids (Join + CapPlanarHoles … etc etc), assemble the connectors and then and assemble the whole combo using some sort of glue.