algorithmic modeling for Rhino
There's an Untrim component, but it untrims everything, it doesn't know how to distinguish between the holes and the boundary. Is that a problem?
Thank You,David. As you know, Untrim component is not a good way to repair the surface with hole,It untrims everything. the command "UntrimHoles"(It is not 'UntrimAllHoles', I'm so sorry) in the rhino can help to repair the hole,when I bake the facade geometry to Rhino. But If I Know using C# code to relaize the command "UntrimHoles", I can repair the facade with holes. Could give me some suggest about how to realize the command?
I can not find an usualfully way to distinguish the holes and the boundary.yestday,I think use the boundary's length to test whether it is an holes or an boundary. but it is an alway right.
The BrepFace class knows which one of it's potentially many loops represents the outer boundary. But I can't find a way to actually use this information to then remove the remaining loops from the face interior.
You may have to ask the Rhino api experts on the discourse forum about how to do this.
You still need some maunal work around but thsi should help.
public static Brep BrepUntrim(Brep brep)
{
List<Brep> b = new List<Brep>();
var f = brep.Faces.ToList();
f.ForEach(x =>
{
var l = x.Loops.ToList();
l = l.Where(y => y.LoopType != BrepLoopType.Inner).ToList();
var tb = x.UnderlyingSurface().ToBrep();
tb = tb.Faces[0].Split(l.ConvertAll(z => z.To3dCurve()), 0.001);
tb = tb.Faces.ToList().ConvertAll(z => z.DuplicateFace(true)).OrderBy(z => z.GetArea()).Last();
b.Add(tb);
});
var untrim = Brep.JoinBreps(b, 0.001).ToList().OrderBy(x => x.GetArea()).Last();
return untrim;
}
You could filter the Faces from the generated Brep a second time for the inner outer loop criteria. I leave you some home work.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by