discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Extracting a part to avoid waste

VB
Verachten Bruno
Wed, Feb 17, 2021 12:49 PM

Hi there,

I'm currently trying to design a jig to help me sharpen my Record #50 bead
cutters.
I was so confident about my work that I printed the result right away...
And of course, I had forgotten to setup a few tolerances here and there, so
some of the parts won't slide in each other.
Stupid me, 10 hours of printing, and most of the parts are unusable.
I changed a few things on the smaller parts and printed them, and they now
slide in.
The problem is that I should now print again the bigger parts, but that
will take ages... And maybe fail again.
So I'm about to try to extract key sub-parts of the bigger parts so that I
can try my modifications in no time.
I think I could do that with a difference between the big part, and the
difference between two cubes (with the inner cube being the volume of the
bigger part's sub-part si want to keep).
But... Do we have somewhere a library that would do the same thing ? Give
it a part, coordinates and it will return a sub-part of the part.

Thanks in advance.

Bruno Verachten

Hi there, I'm currently trying to design a jig to help me sharpen my Record #50 bead cutters. I was so confident about my work that I printed the result right away... And of course, I had forgotten to setup a few tolerances here and there, so some of the parts won't slide in each other. Stupid me, 10 hours of printing, and most of the parts are unusable. I changed a few things on the smaller parts and printed them, and they now slide in. The problem is that I should now print again the bigger parts, but that will take ages... And maybe fail again. So I'm about to try to extract key sub-parts of the bigger parts so that I can try my modifications in no time. I think I could do that with a difference between the big part, and the difference between two cubes (with the inner cube being the volume of the bigger part's sub-part si want to keep). But... Do we have somewhere a library that would do the same thing ? Give it a part, coordinates and it will return a sub-part of the part. Thanks in advance. Bruno Verachten
NH
nop head
Wed, Feb 17, 2021 12:53 PM

I use a module called clip() for that, see
https://github.com/nophead/NopSCADlib#Clip.

On Wed, 17 Feb 2021 at 12:50, Verachten Bruno gounthar@gmail.com wrote:

Hi there,

I'm currently trying to design a jig to help me sharpen my Record #50 bead
cutters.
I was so confident about my work that I printed the result right away...
And of course, I had forgotten to setup a few tolerances here and there, so
some of the parts won't slide in each other.
Stupid me, 10 hours of printing, and most of the parts are unusable.
I changed a few things on the smaller parts and printed them, and they now
slide in.
The problem is that I should now print again the bigger parts, but that
will take ages... And maybe fail again.
So I'm about to try to extract key sub-parts of the bigger parts so that I
can try my modifications in no time.
I think I could do that with a difference between the big part, and the
difference between two cubes (with the inner cube being the volume of the
bigger part's sub-part si want to keep).
But... Do we have somewhere a library that would do the same thing ? Give
it a part, coordinates and it will return a sub-part of the part.

Thanks in advance.

Bruno Verachten


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

I use a module called clip() for that, see https://github.com/nophead/NopSCADlib#Clip. On Wed, 17 Feb 2021 at 12:50, Verachten Bruno <gounthar@gmail.com> wrote: > Hi there, > > I'm currently trying to design a jig to help me sharpen my Record #50 bead > cutters. > I was so confident about my work that I printed the result right away... > And of course, I had forgotten to setup a few tolerances here and there, so > some of the parts won't slide in each other. > Stupid me, 10 hours of printing, and most of the parts are unusable. > I changed a few things on the smaller parts and printed them, and they now > slide in. > The problem is that I should now print again the bigger parts, but that > will take ages... And maybe fail again. > So I'm about to try to extract key sub-parts of the bigger parts so that I > can try my modifications in no time. > I think I could do that with a difference between the big part, and the > difference between two cubes (with the inner cube being the volume of the > bigger part's sub-part si want to keep). > But... Do we have somewhere a library that would do the same thing ? Give > it a part, coordinates and it will return a sub-part of the part. > > Thanks in advance. > > Bruno Verachten > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
JB
Jordan Brown
Wed, Feb 17, 2021 3:04 PM

On 2/17/2021 4:49 AM, Verachten Bruno wrote:

So I'm about to try to extract key sub-parts of the bigger parts so
that I can try my modifications in no time. 
I think I could do that with a difference between the big part, and
the difference between two cubes (with the inner cube being the volume
of the bigger part's sub-part si want to keep).

Maybe I'm not following, but that sounds like a job for intersection(),
not difference().

For the simple case of extracting a "cube" that's aligned on the axes,
why is it anything more than

intersection() {
    mymodel();
    translate([...]) cube([...]);
}

?

To make it easier to pick out the right cube interactively, you might
make it Customizer-friendly:

/* [ Extraction ] */
// Extract a cube?
extract = false;
// Origin of cube to extract?
extract_origin = [ 0, 0, 0 ];
// Size of cube to extract?
extract_size = [ 100, 100, 100 ];

if (extract) {
    intersection() {
        mymodel();
        translate(extract_origin) cube(extract_size);
    }
} else {
    mymodel();
}
On 2/17/2021 4:49 AM, Verachten Bruno wrote: > So I'm about to try to extract key sub-parts of the bigger parts so > that I can try my modifications in no time.  > I think I could do that with a difference between the big part, and > the difference between two cubes (with the inner cube being the volume > of the bigger part's sub-part si want to keep). Maybe I'm not following, but that sounds like a job for intersection(), not difference(). For the simple case of extracting a "cube" that's aligned on the axes, why is it anything more than intersection() { mymodel(); translate([...]) cube([...]); } ? To make it easier to pick out the right cube interactively, you might make it Customizer-friendly: /* [ Extraction ] */ // Extract a cube? extract = false; // Origin of cube to extract? extract_origin = [ 0, 0, 0 ]; // Size of cube to extract? extract_size = [ 100, 100, 100 ]; if (extract) { intersection() { mymodel(); translate(extract_origin) cube(extract_size); } } else { mymodel(); }
VB
Verachten Bruno
Wed, Feb 17, 2021 5:50 PM

So I'm about to try to extract key sub-parts of the bigger parts so that I can try my modifications in no time.
I think I could do that with a difference between the big part, and the difference between two cubes (with the inner cube being the volume of the bigger part's sub-part si want to keep).

Maybe I'm not following, but that sounds like a job for intersection(), not difference().

Yes you're right, I was not crystal clear.

I use a module called clip() for that, see https://github.com/nophead/NopSCADlib#Clip.

That did the trick.

Thanks a lot for your inputs, I have since then made several attempts
with the smallest critical parts sporting my latest changes, and I
noticed a few issues... that will be solved in minutes instead of
hours.

Best regards,

Bruno

> > So I'm about to try to extract key sub-parts of the bigger parts so that I can try my modifications in no time. > > I think I could do that with a difference between the big part, and the difference between two cubes (with the inner cube being the volume of the bigger part's sub-part si want to keep). > Maybe I'm not following, but that sounds like a job for intersection(), not difference(). Yes you're right, I was not crystal clear. > I use a module called clip() for that, see https://github.com/nophead/NopSCADlib#Clip. That did the trick. Thanks a lot for your inputs, I have since then made several attempts with the smallest critical parts sporting my latest changes, and I noticed a few issues... that will be solved in minutes instead of hours. Best regards, Bruno