0
$\begingroup$

I'm trying to create a shape that is the boolean difference of a tilted curve and a cube using geometry nodes.

If the curve is not tilted (twisted) - the result is quite smooth and clean and quite acceptable:

enter image description here

If the curve has a tilt (twisted) like this example curve:

enter image description here

Then the result has horrible jagged edges. enter image description here Even if I turn the resolution or resample the curve up to 128 or 256 it still looks horrible with jagged edges after the boolean operation.

Shade smooth OFF: enter image description here

Shade smooth ON: enter image description here

My node setup looks like this: enter image description here

I understand it's not possible to do boolean operations using pure curves and there is some precision lost when converting to meshes.

There must be a way to get an acceptable result - how to get a cleaner result when doing boolean difference with tilted curve?

Update: To help visualize what I think is happening I created a curve with cube instances on points which is similar to the quadrilateral. With no twist you can see the inside of the curve is smooth. enter image description here As soon as you introduce tilt to the curve it gets wonky. enter image description here

$\endgroup$
6
  • $\begingroup$ i tried your setup and it looks fine on my blender 3.1. what version are you using? can you add a Set Shade Smooth node before the group output and uncheck Shade Smooth then show a screenshot of how that looks for you $\endgroup$
    – Harry McKenzie
    Commented Aug 25, 2022 at 6:31
  • $\begingroup$ Could you share the .blend file? $\endgroup$ Commented Aug 25, 2022 at 7:16
  • $\begingroup$ I'm using Blender 3.2 - I shared the blend file as requested blend-exchange.com/b/RRdSZODZ $\endgroup$
    – stackzz
    Commented Aug 25, 2022 at 7:39
  • $\begingroup$ I updated question to include shade smooth on and off. Both look pretty jagged and rough... the only way I can get it to look reasonable is to turn the curve resolution above 300 which is not practical in my opinion... when I zoom in with resolution 300 it's still zig zag jagged edge... I was hoping to cut these faces on a laser cutter and the zig zag edges make it pretty unusable. $\endgroup$
    – stackzz
    Commented Aug 25, 2022 at 7:51
  • $\begingroup$ The tilted curve faces are non-planar, and you're seeing their triangulation. To improve things, you need to increase the controls on the profile curve-- the quadrilateral. Resample the quadrilateral with a multiple of 4, like 32 or 64. The more loops you cut perpendicular to the length, the more planar your faces, and the less that triangulation will matter. $\endgroup$
    – Nathan
    Commented Aug 25, 2022 at 15:23

3 Answers 3

1
$\begingroup$

And here is a completely different idea to create this shape, including a cutout inside:

enter image description here

Here I first create a basic shape using two curves, which I scale accordingly.

I then extrude this in height.

I scale the upper face that can be selected in this way with an individual center, so that I achieve the shape you sketched.

Finally I separate only the faces, so that I can achieve a different smoothing of the normals.


I have no idea if this is helpful, but I found this to be quite an interesting variation.


(Blender 3.2)

$\endgroup$
1
  • $\begingroup$ wow... very helpful... $\endgroup$
    – stackzz
    Commented Aug 30, 2022 at 17:01
1
$\begingroup$

Credit to @Nathan for his suggestion of Resampling the quadrilateral. enter image description here

I found if you try to adjust the Resample Curve Count while the node is connected blender crashes almost every time if you drag the slider for the number to adjust the count. I had best results if I adjusted the count then connect the node or manually type in a fixed number rather than scrolling through numbers. It accepted numbers that were not multiples of 4 and rendered OK but didn't handle scrolling OK.

I had to turn the count up pretty high (128) to make it look less jagged.

enter image description here

enter image description here It still leaves some artifacts with and without smooth shading on but the result is less jagged and more usable so I consider this an answer.

$\endgroup$
2
  • $\begingroup$ If anybody is able to improve on this so there are no artifacts and it doesn't depend on turning the resampling resolution up really high to get a more pure result... I've thought about using a different shape as the Profile Curve in Curve to Mesh node - for example a Curve Line then solidifying the result but the normals get all wonky... $\endgroup$
    – stackzz
    Commented Aug 29, 2022 at 12:46
  • $\begingroup$ No matter what you do here, you will always (!) produce a weird appearance as long as you don't apply the Geometry Nodes Modifier. This is because the normals are not recalculated, and therefore, caused primarily by Mesh Boolean, will always produce completely unusable normals as long as you use Shade Smooth. And unfortunately there is currently no way to edit the normals directly in Geometry Nodes. $\endgroup$
    – quellenform
    Commented Aug 29, 2022 at 13:13
1
$\begingroup$

Here would be a variant that is not necessarily quite optimal, but at least it delivers:

  • A clean mesh
  • Neatly smoothed normals

enter image description here

The main changes to your example are that here I use a Curve Line as profile for Curve to Mesh, and clip this mesh with a Cube.

The resulting surface I send to the node Convex Hull, which creates a solid mesh from it.

Finally I apply the node Set Shade Smooth to the front faces (the curved faces).

$\endgroup$
5
  • $\begingroup$ This is a really good solution - the Convex Hull does a great job. One use case I can't make it work - If you imagine the curve like a letter D - the Convex Hull generates the straight line connecting the two endpoints of the curve. Making the shape so it creates a solid from the opposite side of the curve - the boolean object is like an extruded C shape. Do you see any way to generate the inverse so the result is like an extruded C? $\endgroup$
    – stackzz
    Commented Aug 30, 2022 at 6:31
  • $\begingroup$ I was able to solve the problem of how to use the opposite side of the curve by adding a second boolean operation that operates on the output of the first boolean operation and it worked perfectly. $\endgroup$
    – stackzz
    Commented Aug 30, 2022 at 6:52
  • $\begingroup$ @stackzz Could you please create a sketch of the object (or objects) you ultimately want to create? I have another idea how you could possibly create such shapes. $\endgroup$
    – quellenform
    Commented Aug 30, 2022 at 7:24
  • 1
    $\begingroup$ I'm working on modeling a parametric boat hull. As far as making a sketch - your last answer below with red shading nailed it on the head. I have learned a lot from all your answers to this question. I'm sure it will be helpful to others also. $\endgroup$
    – stackzz
    Commented Aug 30, 2022 at 17:06
  • $\begingroup$ @stackzz Thanks, glad I could help you! Such a positive feedback makes me happy! $\endgroup$
    – quellenform
    Commented Aug 30, 2022 at 17:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .