Why GH display strangely if the solid brep is created in GHPython with Rhinocommon?

Hello All!:grinning:

The below one is solid brep, after using “rg.CreateSolid” or “rg.MergeBreps” or “rg.JoinBreps” in GHPython
In in the middle is surface in GH, after explode the brep.
The top one is the solid brep after bake into Rhino.

Why the below one’s side face divide into 3 part? Is there any way to let it display flat?

Hi @RetroPost.LT

you’ll need to share the definition, or at least the part that displays the behavior.

Giulio


Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Hi, Giulio Piacentino .
This is the GHpy file blow:
SolidBrepDisplay.gh (4.7 KB)

Hi @RetroPost.LT

I think this is due to the use of Point3d.Unset for the start and end points. I do not think that it’s possible to use no start point and no end point in this case, because there are only two curves to loft.

If I change
rg.Point3d.Unset, rg.Point3d.Unset
to
rs.CurveStartPoint(crv1), rs.CurveStartPoint(crv2),

the problem goes away. Does it help?

Also, incidentally, may I ask if you are seeing the background shadow as moved as in the screenshot above?
image
What is your setup?

Thanks

Giulio


Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

1 Like

Thanks Giulio Piacentino! That solved the display problem.
Yes, the background shadow is moved. There is about static 120 pix shift with ghpy edit window. It’s 2560*1440 display resolution in Win10 64.

Sorry Giulio, the display problem solved but the geometry can’t bake right into Rhino.
I tried several code but still can’t figure out where is the problem.

SolidBrepDisplay.gh (8.9 KB)

Sorry, I don’t know what might be the right method to call.
Maybe @dale knows about this one.

Thanks

Giulio


Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Hi @RetroPost.LT

Your Brep draws odd because it contains kinked surfaces. Recall you lofted a Brep from two polyline curves. The solution is to split kinky surfaces. For example:

import rhinoscriptsyntax as rs
import Rhino.Geometry as rg
import scriptcontext as sc

crv1 = rs.coercecurve(x)
crv2 = crv1.Duplicate()
crv2.Translate(0.0, 0.0, 10.0)
brep = rg.Brep.CreateFromLoft([crv1, crv2], rg.Point3d.Unset, rg.Point3d.Unset, rg.LoftType.Normal, False)[0]
if brep:
    brep.Faces.SplitKinkyFaces()
    brep = brep.CapPlanarHoles(sc.doc.ModelAbsoluteTolerance)
    if brep:
        if brep.SolidOrientation == rg.BrepSolidOrientation.Inward:
            brep.Flip()
a = brep

Does this help?

– Dale

1 Like

Thanks @dale, I keep on forgetting about the oddity of kinky surfaces…

So, @RetroPost.LT, if you use Point3d.Unset and the SplitKinkySurfaces() method, you should get everything working with your original script.

1 Like

That helps a lot. Thank you Dale.:grinning:

Thank you Giulio, sorry for reply so late. I miss this answer before.