Problem with "subtract()"ing "hull()", is this a bug?
-
For drawing a spherical triangle I need to draw 2 "sp_tria2()"s in that triangle on the sphere. "sp_tria2()" might overshoot sphere triangle borders as here:

Next I create "hull()" from 6 points (found no way to do that, created "hull()" of 6 very small "cube()"s instead), the 3 triangle coordinates, and those coordinates scaled up to that "hull()" completely contains the wanted triangle part of "sp_tria2()":

Here is hull definition:
h = hull( cube({center: sv1, size: 0.01}) ,cube({center: sv2, size: 0.01}) ,cube({center: sv3, size: 0.01}) ,cube({center: s1, size: 0.01}) ,cube({center: s2, size: 0.01}) ,cube({center: s3, size: 0.01}) )Why does "subtract()" not work when subtracting "h"?
(subtract does work for look_inside=yes, subtracting sphere and cube from outer sphere)
Here is link for you to play with:
https://openjscad.xyz/?uri=https://stamm-wilbrandt.de/en/forum/Q.JSCAD.vertex_edge2.sp_tria.js... return colorize([0.5,0.5,0.5], subtract( translate([0,0,0], rotate([0,0,la1-degToRad(180)], rotate([0,ph1-degToRad(90),0], rotate([0,0,-al13], sp_tria2(sc, s12, mpi(al13-al12), 0.1, 40, 40) ) ) ) ) ), h ) ..."sp_tria(4,13,14)" call is in line 244 near the end.
-
Oops, too late/early, need to get more sleep.
- problem was bad indentation of brackets and placing ",h" at wrong level.
- problem was that I want "intersect()" and not "subtract()":
return colorize([0.5,0.5,0.5], intersect( translate([0,0,0], rotate([0,0,la1-degToRad(180)], rotate([0,ph1-degToRad(90),0], rotate([0,0,-al13], sp_tria2(sc, s12, mpi(al13-al12), 0.1, 40, 40) ) ) ) ), h ) )Works like a charme now:

-
This post is deleted! -
Forgot to post the "answer" link for viewing in browser:
https://openjscad.xyz/?uri=https://stamm-wilbrandt.de/en/forum/A.JSCAD.vertex_edge2.sp_tria.js -
H Hermann-SW referenced this topic on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login