Closing an extruded shape generated over a circular path

I believe you’ll build confidence over time. To be honest, most of the time, I have no faen clue what I’m doing. But since people from the team as knowledgeable as @RaananW said the same, I feel less of a jerk. Eventually, when I got it right it might as well be just ‘incidental’ :wink: …And then I just apologize for all the rest of the crap I post :grin:

1 Like

@mawa , @WillemCramer I think you’re right, I have been playing with your solution and although it seemed like the best approach it still generates the inner wireframe.

I might be overoptimizing the results, but as you said if it starts being so messy it might be because I didn’t pick the right tool. Do you have any recommendation for a postprocessing tool to recalc the wireframes by any chance?

Also, thank you guys for all the effort at least I could close the profile what was totally worth it. :heart:

1 Like

As I said I’m no true coder. Means I’m not necessarly looking for the 1% optimization and slickest code that in fine, doesn’t change shit to the experience. However, here, looking at this wireframe…well, that’s a bit too much, even for me. It could clearly do with some simplification. I haven’t tried the performance mode yet, I don’t know if it can act on the geometry. At this stage, I’ll gladly let someone else answer.

I tried to apply a simplifying process with no luck:

The geometry generated by CSG is really hard to work with…

it fascinates me now and i have tried a few adjustments too with no luck
i think CSG is not the right way to go indeed. best keep thinking shapes as long as possible

now i only wonder why the result seems to result in a flatShadedMesh

looks ok here

I guess it’s not the main issue here. This simple shape generates 50k vertices and 16k faces. I’d say it’s useless as is.

hahahahaha - i never checked :wink:

only other hand - compared with images/textures :thinking:

Yep, thats a huge downside when doing more operations on the same shape :frowning:

result with using a lathe as a cutter
vertices = 1233

geometry still looks odd
sampling IS set to 17 instead of 33 first
at 33 it’s 3781

thing is with the first example is that i was imagining a physical machine doing it. hence the rotation approach

One thing is for sure: You do have a lot more patience than I have :grin: I admit at this point, I gave up with this approach. But praise you if you find the solution :smiley: :hugs:

I`ll give it a try tomorrow with lathes, thanks!

Hello again, @WillemCramer, @mawa, @shaderbytes, @Evgeni_Popov. I have been trying all the approaches that you suggested, but the problem persists. I can reduce the number of vertices by decreasing the number of steps in the extrusion process, but that’s about it.

I believe the problem is somewhat similar to the one discussed in this particular thread: How to delete obsolete vertices / facets? How to get only the "real" ones?.

When you examine the shape more closely, you can see that several vertices are being generated along straight lines. I didn’t think this was possible in a 3D render.

I also considered the possibility that the issue lies in the way I am generating the final form by doing the CSG operation, but I haven’t been able to find an alternative method. Am I hitting the end of the road here?

Yeah, I think we all pretty much are at the same state here with this. Honestly, if even @Evgeni_Popov (despite for claiming not being a specialist) says the CSG operation is ‘obscure’, I have to trust him on that. At this point, all I (with my small brain) can see as a solution is to either take a completely different approach or eventually try to challenge @Deltakosh on this :grin: I know he likes challenges, so may be? :rofl: :joy:

As @mawa said, you might want to try another method (using an external library?), as the current CSG implementation is something of a black box and there’s not much we can do to change the way it works.

Thanks! I’ll do more research, then. But, to throw more light over this issue, should I document this a little bit more and open an issue on the babylon GH repo?

I think we can add some additional doc in the CSG class to indicate that the geometry generated by CSG operations is generally complex and may be not well suited for some operations?

1 Like

I can’t help with the CSG problem in general, but the original problem of extruding shapes on a closed path is based on problems with Path3d, demonstrated here: https://playground.babylonjs.com/#2DLXYB#269
There are two related problems:

  • The initial and final tangents and binormals do not take into account that they are at the same point, so they are different and only based on the initial or final segment. Note that at midpoints in the path, Path3d computes reasonable average tangents and binormals.
  • At the initial and final point on the closed path, you get two different binormals, which gives two different locations for placing the points for the ribbon path, which then need to be connected by a spurious segment.

I think a fix for Path3d to support closed paths would eliminate many of the issues with extrusions and make the resulting extrusion cleaner and simpler for things like CSG

1 Like