Problem with BrepCP

I have this closed Brep

which is comprised of two Open Breps that are joined at the wavy curve in the middle. (The result is still an Open Brep, but I turned that into a Closed Brep by giving it some thickness.)

I want to decorate the bottom half by Orienting some small geometry pieces onto it. The attached GH file does that, but the results look like this:

which results in this:

I think the problem has to do with BrepCP because it’s results look like this:
i thought I could use SrfMorph, but can’t because it requires a Surface as input and my geometry is a Loft which makes Breps.

Is there some other approach that will fix this? (222.6 KB)

I see a lot of things wrong with this but the one I focused on was replacing the square point pattern with circles. White group replaces disabled components. (221.1 KB)

The yellow group (below) filters out the small capped cylinders that are too close to the edge. (222.5 KB)

The purple group attempting to make a single “Closed Brep” fails miserably!! (as your GH does) :question:

Aha! Your method of creating the closest points works exactly the way I wanted it to, and it is far simpler than the approach I chose. I don’t understand exactly why there is such a difference between the 2 methods, but it’s the end result that counts. So thanks for (again) demonstrating that the simplest approach is usually the best approach.

FYI the little cylinders I made were just for demonstration purposes. The actual geometry I’ll use for the decorations is still undefined. What matters is as long as everything ends up as a bunch of Closed Breps I can slice and print it with no problems. So there is no need to merge them into a single Closed Brep. I gave up trying to solve this one a long time ago.

I disagree. Understanding the code and geometry is VERY IMPORTANT :exclamation:

Too bad. (65.3 KB)


If only my printer could print in fancy colors!

It’s not the colors, it’s the algorithm. Those capped cylinders are perfectly placed. :sunglasses:

I know - but they can’t be printed because they have unsupported bottom surfaces that can only be printed in zero-G. So I have substituted smaller, flatter disk shaped thingies that I think will print OK.

Your approach for culling out mis-aligned ones is just excellent. :grinning:

There is much more in my version ‘c’ above than just culling of points based on distance to the edge. That’s old school simple stuff compared to what I did to align points with the peaks. I know you’re not interested in understanding it but someone else might be.

It’s not that I’m not interested - it’s that my focus is on getting to a design that will print. I agree your method for aligning the oriented points is elegant, but I was able to mimic that function with a simple 2D rotation. It’s not as elegant as your method, but it works for me.

Not the same and nowhere nearly as accurate, if that’s it in the last image you posted. Whatever…