Replies: 2 comments 1 reply
-
On Apr 9, 2025, at 4:23 PM, Aeonik Chaos ***@***.***> wrote:
Hello Everyone!
How can I improve this dual-duct-to-merged-outlet skin() approach?
I'm working on generating a parametric dual-inlet duct that smoothly transitions to a larger outlet. After ~8 hours of wrangling BOSL2's path_sweep, skin, and path composition tools, I got something working — but I’m sure there’s a better way.
Here's the working minimal version (🎉 finally):
include <BOSL2/std.scad>
$fn = $preview ? 64 : 128;
shape1 = left(20, p=circle($fn=70, r=30));
shape2 = right(20, p=circle($fn=70, r=30));
shape3 = up(50, p=[path3d(circle(r=50))]);
rgn = force_path(union(shape1, shape2));
skin([
zrot(-90, p=shape3), // output profile
path3d(rgn) // combined inlet region
], slices=0);
That's more or less how I'd do it. Though instead of `force_path(union(...))`, I'd just do `union(...)[0]` for brevity, since I already know the circles overlap, and `union()` will return a singleton.
The force_path(union(...)) trick worked. But it feels like a workaround, not a recommended pattern. It would be helpful to know if:
This approach is valid and future-safe
Yes, that's perfectly fine, if, and only if, you know the output will be a single path.
There are better primitives for merging paths before lofting
Functional forms of `union()` / `difference()` / `intersection()` are the canonical way of doing polygon boolean geometry.
Another method you may want to investigate is using the new `metaballs()` feature of `isosurface.scad`.
https://github.com/BelfrySCAD/BOSL2/wiki/isosurface.scad#functionmodule-metaballs
isosurface.scad
github.com
- Revar
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
aeonik
-
The function forms of `union()`, `difference()`, `intersection()`, etc all return Regions. A Region is just a list of polygon paths, the first of which should always be a perimeter, with subsequent paths being either separate disconnected perimeters, or holes inside one of the perimeters. If you know the output of an operation will result in a single contiguous shape with no holes, then the region returned will contain exactly one polygon path, which will always be at index 0.
https://github.com/BelfrySCAD/BOSL2/wiki/regions.scad#section-regions
regions.scad
github.com
- Revar
… On Apr 10, 2025, at 6:18 AM, Aeonik Chaos ***@***.***> wrote:
union()[0]
This blew my mind. This is what I was missing the entire time, I kept trying to use union without unwrapping the extra list.
Meatballs looks awesome, thanks for sharing, I saw that while reading the docs, but didn't make the connection for some reason. I had also tried glued_circles, but needed a bit more flexibility.
Thanks again!
—
Reply to this email directly, view it on GitHub <#1621 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AACVOMK347STVV73BFJGV7T2YZVUDAVCNFSM6AAAAAB22FZ5BSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTENZZGE3TINQ>.
You are receiving this because you commented.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello Everyone!
How can I improve this dual-duct-to-merged-outlet
skin()
approach?I'm working on generating a parametric dual-inlet duct that smoothly transitions to a larger outlet. After ~8 hours of wrangling BOSL2's
path_sweep
,skin
, and path composition tools, I got something working — but I’m sure there’s a better way.Here's the working minimal version (🎉 finally):
❓My questions:
skin()
?force_path(union(...))
the best way to get a clean path merge from two offset circles?path_sweep()
transforms, rather than building the region manually?🧪 What I tried before
I initially tried using
path_sweep()
withtransforms=true
and combining the slices:This often led to:
skin()
not liking the merged profiles🐠 Turtle approach
I also experimented with
turtle()
andpath_sweep()
for more control:🔄 Other attempts
I tried this too:
But it often resulted in:
skin()
📚 References
I found useful prior discussion here:
These were helpful but highlighted some impedance mismatches between
path_sweep
,skin
, and the available composition tools.✅ Summary
The
force_path(union(...))
trick worked. But it feels like a workaround, not a recommended pattern. It would be helpful to know if:union_path()
helper would be useful in BOSL2?Thanks in advance — this library is insanely powerful, and I’m deep into it now 🚰
Regards,
Aeonik
Edit:


I added pictures of final model working, and examples of some of the broken code for others to reference.
Broken Stuff:
Working models:


Beta Was this translation helpful? Give feedback.
All reactions