Parting Line?

classic Classic list List threaded Threaded
18 messages Options
Dan
Reply | Threaded
Open this post in threaded view
|

Parting Line?

Dan
This post has NOT been accepted by the mailing list yet.
I sent the following via e-mail but did not see it posted in the forum nor did I receive an e-mail copy.  Since I am new here and not sure how things work I re-posted it in the forum.  Please forgive me if that was a mistake.
-------------------------------
I would like to generate a parting line in order to be able to
facilitate casting of a part that was imported as an stl file.  It will
not be a simple plane but a surface because the object is organic and
the parting line will not be thru the symmetry plane.  If I can
programmatically read the coordinates of points on the surface then I
should be able to generate a program to do what I want.  It appears to
me that that capability does not exist.  Can someone help me?  Is there
an existing package that does this already?
-------------------------------
I subsequently looked at the linear extrude command and noticed it takes a 2d object.  What I want to do is extrude a line in one dimension to form a surface and then extrude that surface in one direction.  It looks like openscad is just not the tool for this.  Am I out of luck?
Reply | Threaded
Open this post in threaded view
|

Re: Parting Line?

MichaelAtOz
Administrator
Hi Dan, your post is flagged as not being sent to the mailing list, you need to complete the registration here.
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: Parting Line?

Neon22
In reply to this post by Dan
You can use projection to have the system find the widest parts along an axis. This can be used to make a two part mold.
However AFAIK this projection can't be used as e.g. a series of points to go into a further polygon operation.
In fact I don't think it can be examined in any way... but someone else may know an approach ?
Reply | Threaded
Open this post in threaded view
|

Re: Parting Line?

Peter Falke
Is this what you want to do?



And you want to do this automatically?

Note: there is not always a solution to your problem.
---- Code ____
r1=30;
r2=20;

x1=90;
z1=30;

rc=10;

rp=2;


module sphere1(r1=r1){
    sphere(r1);
    color("red")
    rotate_extrude()translate([r1,0,0])circle(rp);
}


sphere1();
translate([x1,0,z1])sphere1();

hull(){
    sphere(rc);
    translate([x1,0,z1])sphere(rc);
}

color("red"){
    hull(){
        translate([0,-rc,0])sphere(rp);
        translate([x1,0,z1])translate([0,-rc,0])sphere(rp);
    }
    hull(){
        translate([0,+rc,0])sphere(rp);
        translate([x1,0,z1])translate([0,+rc,0])sphere(rp);
    }
}
Reply | Threaded
Open this post in threaded view
|

Re: Parting Line?

Neon22
I wonder if you could take that, use projection() (not the cut version) and then extrude that shape back up and difference the entire thing. Just an idea - will try later...
Dan
Reply | Threaded
Open this post in threaded view
|

Re: Parting Line?

Dan
In reply to this post by Neon22
Neon22 wrote
You can use projection to have the system find the widest parts along an axis.
Unfortunately this results in a plane.  I need a non-planar surface as the result.  That then needs to be turned into a solid to subtract from the original object.
Dan
Reply | Threaded
Open this post in threaded view
|

Re: Parting Line?

Dan
In reply to this post by Peter Falke
Peter Falke wrote
Is this what you want to do?

And you want to do this automatically?

Note: there is not always a solution to your problem.
That is similar to what I want but that is not it.  How would you generate a parting line for this?
---- Code ____
 hull() {
   sphere(10);
   translate([15,0,10]) sphere(10);
 }
 hull() {
   translate([15,0,10]) sphere(10);
   translate([45,0,0]) sphere(10);
 }
Reply | Threaded
Open this post in threaded view
|

Re: Parting Line?

Peter Falke
When you set

r1=10;
r2=10;

in my code your getting pretty close.

But do you want to do this automatically for arbitrary .stl's, or do you want to do it with simple shapes, as in the example.

And one more thing to consider: what do you want to do with this "parting line".

In my example it is a 3d shape.

My geues you want it to cut your molde in two (or more) parts.




2015-09-07 18:43 GMT+02:00 Dan <[hidden email]>:
Peter Falke wrote
> Is this what you want to do?
>
> And you want to do this automatically?
>
> Note: there is not always a solution to your problem.

That is similar to what I want but that is not it.  How would you generate a
parting line for this?
---- Code ____
 hull() {
   sphere(10);
   translate([15,0,10]) sphere(10);
 }
 hull() {
   translate([15,0,10]) sphere(10);
   translate([45,0,0]) sphere(10);
 }



--
View this message in context: http://forum.openscad.org/Parting-Line-tp13715p13728.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



--
[hidden email]

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Parting Line?

Peter Falke
Here is a quick and dirty way to do it with arbitrarry shapes.
(This cound be impruved by using the 2d commands for growing and shrinking 2d-shapes)




 eps=0.999;
 
 
 module shape(){
     hull() {
       sphere(10);
       translate([15,0,10]) sphere(10);
     }
     hull() {
       translate([15,0,10]) sphere(10);
       translate([45,0,0]) sphere(10);
     }
 }
 
module proj(){projection()shape();}

scale([2-eps,2-eps,1])color("red")
intersection(){
translate([0,0,-50])linear_extrude(convexity=6)
difference(){
    proj();
    scale([eps,eps])proj();
}
   
    shape();
}

shape();

2015-09-07 21:23 GMT+02:00 Peter Falke <[hidden email]>:
When you set

r1=10;
r2=10;

in my code your getting pretty close.

But do you want to do this automatically for arbitrary .stl's, or do you want to do it with simple shapes, as in the example.

And one more thing to consider: what do you want to do with this "parting line".

In my example it is a 3d shape.

My geues you want it to cut your molde in two (or more) parts.




2015-09-07 18:43 GMT+02:00 Dan <[hidden email]>:
Peter Falke wrote
> Is this what you want to do?
>
> And you want to do this automatically?
>
> Note: there is not always a solution to your problem.

That is similar to what I want but that is not it.  How would you generate a
parting line for this?
---- Code ____
 hull() {
   sphere(10);
   translate([15,0,10]) sphere(10);
 }
 hull() {
   translate([15,0,10]) sphere(10);
   translate([45,0,0]) sphere(10);
 }



--
View this message in context: http://forum.openscad.org/Parting-Line-tp13715p13728.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



--
[hidden email]

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!



--
[hidden email]

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

PartingLine_shape.scad (640 bytes) Download Attachment
Dan
Reply | Threaded
Open this post in threaded view
|

Re: Parting Line?

Dan
Peter Falke wrote
Here is a quick and dirty way to do it with arbitrarry shapes.
(This cound be impruved by using the 2d commands for growing and shrinking
2d-shapes)
That is getting closer.  I just need the red part to be a line (no dimension in the z axis) and then extrude that into a surface along the xy directions, then extrude a solid in the z direction and subtract the object from the solid.  The other half of the mold is created from extruding in the -z direction.  It needs to be a line because there can't be any gaps between the z and -z parts.
Reply | Threaded
Open this post in threaded view
|

Re: Parting Line?

Peter Falke
Yes, I was afraid that that is what you needed.

2015-09-07 23:04 GMT+02:00 Dan <[hidden email]>:
Peter Falke wrote
> Here is a quick and dirty way to do it with arbitrarry shapes.
> (This cound be impruved by using the 2d commands for growing and shrinking
> 2d-shapes)

That is getting closer.  I just need the red part to be a line (no dimension
in the z axis) and then extrude that into a surface along the xy directions,
then extrude a solid in the z direction and subtract the object from the
solid.  The other half of the mold is created from extruding in the -z
direction.  It needs to be a line because there can't be any gaps between
the z and -z parts.



--
View this message in context: http://forum.openscad.org/Parting-Line-tp13715p13734.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



--
[hidden email]

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Dan
Reply | Threaded
Open this post in threaded view
|

Re: Parting Line?

Dan
In reply to this post by Peter Falke
Peter Falke wrote
When you set

r1=10;
r2=10;

in my code your getting pretty close.

But do you want to do this automatically for arbitrary .stl's, or do you
want to do it with simple shapes, as in the example.

And one more thing to consider: what do you want to do with this "parting
line".

In my example it is a 3d shape.

My geues you want it to cut your molde in two (or more) parts.
You can change the radius of the middle sphere to a different number from the start and end spheres to be more representative.  (see below)

The object I ultimately want to mold is from an .stl file not simple geometric shapes.  If you created a cube around the .stl, subtract the .stl from the cube, and then split the cube in two along the parting line that would be my solution.

---Code---
module shape(){
     hull() {
       sphere(10);
       translate([15,0,10]) sphere(5);
     }
     hull() {
       translate([15,0,10]) sphere(5);
       translate([45,0,0]) sphere(10);
     }
 }
Reply | Threaded
Open this post in threaded view
|

Re: Parting Line?

Peter Falke
In reply to this post by Peter Falke
Now, here is a video of someone doing it in Solidworks:
https://www.youtube.com/watch?v=wzEDtLCFKMs

Pretty cumplicated, and doing it with a part created in solidworks.

2015-09-07 23:10 GMT+02:00 Peter Falke <[hidden email]>:
Yes, I was afraid that that is what you needed.

2015-09-07 23:04 GMT+02:00 Dan <[hidden email]>:
Peter Falke wrote
> Here is a quick and dirty way to do it with arbitrarry shapes.
> (This cound be impruved by using the 2d commands for growing and shrinking
> 2d-shapes)

That is getting closer.  I just need the red part to be a line (no dimension
in the z axis) and then extrude that into a surface along the xy directions,
then extrude a solid in the z direction and subtract the object from the
solid.  The other half of the mold is created from extruding in the -z
direction.  It needs to be a line because there can't be any gaps between
the z and -z parts.



--
View this message in context: http://forum.openscad.org/Parting-Line-tp13715p13734.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



--
[hidden email]

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!



--
[hidden email]

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Parting Line?

Neon22
This post was updated on .
Here's a refinement using children.
Still only generates a thin shell object.
Alas the morphology operators only work on 2D shapes . Else could outset the resulting shell and difference it with a cube.
I've highlighted the cube mod and used inset so it works on arbitrary stl files.

eps=0.01;
use<scad-utils/morphology.scad>;

// sample shape
module shape()  {
        hull() {
                sphere(10);
                translate([15,0,10]) sphere(10);
        }
        hull() {
                translate([15,0,10]) sphere(10);
                translate([45,0,0]) sphere(10);
        }
}
 
// Generate parting line object
module parting_1() {
        // Call with a child object of any kind
        scale([1+eps,1+eps,1])color("red")
        intersection(){
                // move object below origin
                translate([0,0,-50])
                linear_extrude(convexity=6)
                        // create a thin border line (flat at origin)
                        #difference(){
                                square(size=[200,100], center=true);
                                inset(d=eps)
                                projection()
                                        children(0);
                        }
                // intersect with shape to create shell
                children(0);
        }
}

//
parting_1() shape();
shape();
parting line
Reply | Threaded
Open this post in threaded view
|

Re: Parting Line?

Neon22
Ideally the projection() function would somehow make a polygon list available.
Then if we could test if intersection() of a point, projected along Z, hit an object and the resulting XYZ location we could then construct a polyhedron from resulting list of intersection points.
This could then be further adjusted using existing tools to make a two part mold.

any chance of thi skind of interaction in OpenSCAD2 ?
Reply | Threaded
Open this post in threaded view
|

Re: Parting Line?

MichaelAtOz
Administrator
...again we come to the dichotomy of OpenSCAD; currently OpenSCAD is a geometry generator as a descriptive language, lately people want to make it an iterative geometry processor, other languages do that.

(yes I have asked for stuff like bounding box in the past...)
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: Parting Line?

Neon22
This post was updated on .
yes - indeed.
However my point is to not go as far as that but to see if we can do this kind of op with a sensible set of useful operations within OpenSCAD.
I.e. is there a way to use the core to construct (which I feel is reasonable) a negative mold of a complex part.

My suggestion is to facilitate this within the design of OpenSCAD, not to turn it into a more complex programming lang.

E.g.
- we have list comprehensions and we can construct polys from lists and polyhedrons from lists.
- we should also (IMHO) be able to get a list back from a projection() so we can use it in a list comprehension to further adjust it...
- I agree BBOX() is another super useful thing for exact same reasons.
  - potentially a query like bbox(modulename) would fit into the language (the geometry from the module being discarded from the CSG tree).

So:
 - bbox(modulename);  could return a list of min,max XYZ triplets.
 - 2D(projection(modulename));  could return a nested polygon list. I.e. points and paths.
 - hit_test(object1, object2);  could return a true or false depending on the existance of an intersected result. Or better, an XYZ triplet of center of bbox of the intersected objects.
In all three cases any resulting geometry would be discarded (or hidden(*) so caches would be kept) from the final tree.

In this way there is minimal adjustment to how OpenSCAD currently works.
Dan
Reply | Threaded
Open this post in threaded view
|

Re: Parting Line?

Dan
In reply to this post by Neon22
This would make sense to me.  As opposed to the gyrations that may not
work well.

On 2015-09-07 21:06, Neon22 [via OpenSCAD] wrote:
> Ideally the projection() function would somehow make a polygon list
> available.
> Then if we could test if intersection() of a point, projected along Z,
> hit an object and the resulting XYZ location we could then construct a
> polyhedron from resulting list of intersection points.
> This could then be further adjusted using existing tools to make a two
> part mold.
>
> any chance of thi skind of interaction in OpenSCAD2 ?