discuss@lists.openscad.org

OpenSCAD general discussion

View all threads

Another step is needed, but unsure how to do it

JW
Joe Weinpert
Fri, May 13, 2022 1:37 AM

These are the lines at the end of a test scad I've been playing with to
bend (wrap) a rather intricate object:

vnfBoundry = pointlist_bounds( vnf2[0] );

left( vnfBoundry[0].x )

fwd( vnfBoundry[0].y )
down( vnfBoundry[0].z )
render()
difference(){
vnf_polyhedron( vnf2 );
cyl(
l = picY,
r = bendRadius+3,
anchor = CENTER,
orient = FRONT,
$fn = 128
);
}

This all works fine, however ....

Another step needs to be done and I am unsure how to structure the code to
do it.

I need to take the final object here and attach it to another object that
was created earlier in the code so together they make one object that can
be manipulated, rendered and saved as an STL.

I am wondering how to do that.  Can these final few lines above for this
object (starting with left()) be used to somehow create another vnf object
array that I can manipulate?

The reason for these last few lines that you see here is to take the bent
object and place it in the zero position of the positive quad then shove a
cylinder into the middle of it to remove some unwanted garbage from the
object.

This works fine.

But now that I have the object, I need to manipulate it which makes me
think that a vnf array of the object is required.  Unsure.

BTW, the reason for the render() call is because without it it is difficult
to get openSCAD to react to anything from the keyboard and mouse.

These are the lines at the end of a test scad I've been playing with to bend (wrap) a rather intricate object: vnfBoundry = pointlist_bounds( vnf2[0] ); left( vnfBoundry[0].x ) fwd( vnfBoundry[0].y ) down( vnfBoundry[0].z ) render() difference(){ vnf_polyhedron( vnf2 ); cyl( l = picY, r = bendRadius+3, anchor = CENTER, orient = FRONT, $fn = 128 ); } This all works fine, however .... Another step needs to be done and I am unsure how to structure the code to do it. I need to take the final object here and attach it to another object that was created earlier in the code so together they make one object that can be manipulated, rendered and saved as an STL. I am wondering how to do that. Can these final few lines above for this object (starting with left()) be used to somehow create another vnf object array that I can manipulate? The reason for these last few lines that you see here is to take the bent object and place it in the zero position of the positive quad then shove a cylinder into the middle of it to remove some unwanted garbage from the object. This works fine. But now that I have the object, I need to manipulate it which makes me think that a vnf array of the object is required. Unsure. BTW, the reason for the render() call is because without it it is difficult to get openSCAD to react to anything from the keyboard and mouse.
JB
Jordan Brown
Fri, May 13, 2022 4:35 AM

On 5/12/2022 6:37 PM, Joe Weinpert wrote:

I need to take the final object here and attach it to another object
that was created earlier in the code so together they make one object
that can be manipulated, rendered and saved as an STL.

If you've generated it, if you've used either raw OpenSCAD operations or
BOSL2 operations to actually make it appear in the preview, it's
implicitly unioned together with all of the other objects.  You
shouldn't need to do anything additional.

If you haven't actually turned it into real geometry, if you still just
have a VNF array, all you need to do is to vnf_polyhedron() it.

If it shows up in a preview (and is correct in terms of
self-intersections, manifold-ness, and all of that goop) then it will
all export as one STL.

The reason for these last few lines that you see here is to take the
bent object and place it in the zero position of the positive quad
then shove a cylinder into the middle of it to remove some unwanted
garbage from the object.

This works fine.

But now that I have the object, I need to manipulate it which makes me
think that a vnf array of the object is required.  Unsure.

Depends on how you want to manipulate it.  If you want to do ordinary
OpenSCAD operations... you have an OpenSCAD geometric object, created by
the vnf_polyhedron() call, modified by the difference(), and moved by
the left/fwd/down.  (Which look like a complicated way to say
"translate(vnfBoundry[0])".)  Do whatever you want with it.

If you need to do further BOSL2 operations that require VNFs, you'd need
some way to do a difference on a VNF.  I don't know enough BOSL2 to know
whether that's available.

On 5/12/2022 6:37 PM, Joe Weinpert wrote: > I need to take the final object here and attach it to another object > that was created earlier in the code so together they make one object > that can be manipulated, rendered and saved as an STL. If you've generated it, if you've used either raw OpenSCAD operations or BOSL2 operations to actually make it appear in the preview, it's implicitly unioned together with all of the other objects.  You shouldn't need to do anything additional. If you haven't actually turned it into real geometry, if you still just have a VNF array, all you need to do is to vnf_polyhedron() it. If it shows up in a preview (and is correct in terms of self-intersections, manifold-ness, and all of that goop) then it will all export as one STL. > The reason for these last few lines that you see here is to take the > bent object and place it in the zero position of the positive quad > then shove a cylinder into the middle of it to remove some unwanted > garbage from the object. > > This works fine. > > But now that I have the object, I need to manipulate it which makes me > think that a vnf array of the object is required.  Unsure. Depends on how you want to manipulate it.  If you want to do ordinary OpenSCAD operations... you have an OpenSCAD geometric object, created by the vnf_polyhedron() call, modified by the difference(), and moved by the left/fwd/down.  (Which look like a complicated way to say "translate(vnfBoundry[0])".)  Do whatever you want with it. If you need to do further BOSL2 operations that require VNFs, you'd need some way to do a difference on a VNF.  I don't know enough BOSL2 to know whether that's available.
AM
Adrian Mariano
Fri, May 13, 2022 4:52 AM

Yeah, it depends on the specific model and what further operation you
want to do.  There aren't very many BOSL2 operations that actually use
a VNF, but if you need to have a vnf the only way to do that would be
to use cyl() to produce a cylinder VNF and then merge it with your
original VNF in such a way that the face orientations are correct, and
you have correctly connected it to your existing structure.  This
would be nontrivial.  The library does not support boolean operations
on VNFs.

On Fri, May 13, 2022 at 12:36 AM Jordan Brown
openscad@jordan.maileater.net wrote:

On 5/12/2022 6:37 PM, Joe Weinpert wrote:

I need to take the final object here and attach it to another object that was created earlier in the code so together they make one object that can be manipulated, rendered and saved as an STL.

If you've generated it, if you've used either raw OpenSCAD operations or BOSL2 operations to actually make it appear in the preview, it's implicitly unioned together with all of the other objects.  You shouldn't need to do anything additional.

If you haven't actually turned it into real geometry, if you still just have a VNF array, all you need to do is to vnf_polyhedron() it.

If it shows up in a preview (and is correct in terms of self-intersections, manifold-ness, and all of that goop) then it will all export as one STL.

The reason for these last few lines that you see here is to take the bent object and place it in the zero position of the positive quad then shove a cylinder into the middle of it to remove some unwanted garbage from the object.

This works fine.

But now that I have the object, I need to manipulate it which makes me think that a vnf array of the object is required.  Unsure.

Depends on how you want to manipulate it.  If you want to do ordinary OpenSCAD operations... you have an OpenSCAD geometric object, created by the vnf_polyhedron() call, modified by the difference(), and moved by the left/fwd/down.  (Which look like a complicated way to say "translate(vnfBoundry[0])".)  Do whatever you want with it.

If you need to do further BOSL2 operations that require VNFs, you'd need some way to do a difference on a VNF.  I don't know enough BOSL2 to know whether that's available.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Yeah, it depends on the specific model and what further operation you want to do. There aren't very many BOSL2 operations that actually use a VNF, but if you need to have a vnf the only way to do that would be to use cyl() to produce a cylinder VNF and then merge it with your original VNF in such a way that the face orientations are correct, and you have correctly connected it to your existing structure. This would be nontrivial. The library does not support boolean operations on VNFs. On Fri, May 13, 2022 at 12:36 AM Jordan Brown <openscad@jordan.maileater.net> wrote: > > On 5/12/2022 6:37 PM, Joe Weinpert wrote: > > I need to take the final object here and attach it to another object that was created earlier in the code so together they make one object that can be manipulated, rendered and saved as an STL. > > > If you've generated it, if you've used either raw OpenSCAD operations or BOSL2 operations to actually make it appear in the preview, it's implicitly unioned together with all of the other objects. You shouldn't need to do anything additional. > > If you haven't actually turned it into real geometry, if you still just have a VNF array, all you need to do is to vnf_polyhedron() it. > > If it shows up in a preview (and is correct in terms of self-intersections, manifold-ness, and all of that goop) then it will all export as one STL. > > The reason for these last few lines that you see here is to take the bent object and place it in the zero position of the positive quad then shove a cylinder into the middle of it to remove some unwanted garbage from the object. > > This works fine. > > But now that I have the object, I need to manipulate it which makes me think that a vnf array of the object is required. Unsure. > > > Depends on how you want to manipulate it. If you want to do ordinary OpenSCAD operations... you have an OpenSCAD geometric object, created by the vnf_polyhedron() call, modified by the difference(), and moved by the left/fwd/down. (Which look like a complicated way to say "translate(vnfBoundry[0])".) Do whatever you want with it. > > If you need to do further BOSL2 operations that require VNFs, you'd need some way to do a difference on a VNF. I don't know enough BOSL2 to know whether that's available. > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org