discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Surface extraction

SP
Sanjeev Prabhakar
Fri, Feb 24, 2023 1:28 PM

I have a requirement to develop a casting mould for a part e.g. wheel.

All the surfaces which are visible from top needs to be extracted to get
one half of the mould.

Similarly surfaces which are visible from bottom needs to be extracted to
develop other side of the mould.

Parting lines can be zigzag depending on the part geometry.

Any ideas to do such a thing in openscad will be really helpful

Regards
Sanjeev

I have a requirement to develop a casting mould for a part e.g. wheel. All the surfaces which are visible from top needs to be extracted to get one half of the mould. Similarly surfaces which are visible from bottom needs to be extracted to develop other side of the mould. Parting lines can be zigzag depending on the part geometry. Any ideas to do such a thing in openscad will be really helpful Regards Sanjeev
GS
Guenther Sohler
Fri, Feb 24, 2023 1:44 PM

hi Sanjeev,

I know exactly what you mean, I also do green-sand-casting and demolding it
the key for successful metal casting.

I spent over 6 month on writing software to find the best split of a given
bust stl file programmatically. the tool is called "stltool"

Right now developing the tool is on hold as I need some time for more
inspiration.

Examples of successful splits are here:

https://twitter.com/gadget_3d/status/1581385519308890112/photo/1

was also able to split "batman" mold successfully, but by far not all bust
are splittable for molding.

when splitting your weel, which is very symmetrical, isn't it possible to
split the face at the symmetry line using "difference" or "intersection" ?


when you very easily split your triangles into two bins when watching if
the z coordinate of the normal vector is pointing up or down.

For my tool i spent

25% of the time on finding the best cut line around the model
75% of the time to filling the big hole in the model which arises when
splitting the model into 2 halves ....

On Fri, Feb 24, 2023 at 2:29 PM Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

I have a requirement to develop a casting mould for a part e.g. wheel.

All the surfaces which are visible from top needs to be extracted to get
one half of the mould.

Similarly surfaces which are visible from bottom needs to be extracted to
develop other side of the mould.

Parting lines can be zigzag depending on the part geometry.

Any ideas to do such a thing in openscad will be really helpful

Regards
Sanjeev


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

hi Sanjeev, I know exactly what you mean, I also do green-sand-casting and demolding it *the* key for successful metal casting. I spent over 6 month on writing software to find the best split of a given bust stl file programmatically. the tool is called "stltool" Right now developing the tool is on hold as I need some time for more inspiration. Examples of successful splits are here: https://twitter.com/gadget_3d/status/1581385519308890112/photo/1 was also able to split "batman" mold successfully, but by far not all bust are splittable for molding. when splitting your weel, which is very symmetrical, isn't it possible to split the face at the symmetry line using "difference" or "intersection" ? -------- when you very easily split your triangles into two bins when watching if the z coordinate of the normal vector is pointing up or down. For my tool i spent 25% of the time on finding the best cut line around the model 75% of the time to filling the big hole in the model which arises when splitting the model into 2 halves .... On Fri, Feb 24, 2023 at 2:29 PM Sanjeev Prabhakar <sprabhakar2006@gmail.com> wrote: > I have a requirement to develop a casting mould for a part e.g. wheel. > > All the surfaces which are visible from top needs to be extracted to get > one half of the mould. > > Similarly surfaces which are visible from bottom needs to be extracted to > develop other side of the mould. > > Parting lines can be zigzag depending on the part geometry. > > Any ideas to do such a thing in openscad will be really helpful > > Regards > Sanjeev > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
SP
Sanjeev Prabhakar
Fri, Feb 24, 2023 2:05 PM

Hi Guenther

Your picture of the split looks interesting.

Can you give some more information on the workflow and the logic.

In case it is possible to share the stltool developed by you, would be
great, although i have very limited understanding of softwares.

I started working on openscad as it initially looked simpler to work on.

Then learnt a little bit of python to circumvent the limitations of
openscad language.

Now it seems I need to learn another one. Not sure if I will do that as it
is taking a lot of my time.

Anyway, I am not using it for any professional purposes and is a hobby.

On Fri, 24 Feb, 2023, 7:15 pm Guenther Sohler, guenther.sohler@gmail.com
wrote:

hi Sanjeev,

I know exactly what you mean, I also do green-sand-casting and demolding
it the key for successful metal casting.

I spent over 6 month on writing software to find the best split of a given
bust stl file programmatically. the tool is called "stltool"

Right now developing the tool is on hold as I need some time for more
inspiration.

Examples of successful splits are here:

https://twitter.com/gadget_3d/status/1581385519308890112/photo/1

was also able to split "batman" mold successfully, but by far not all bust
are splittable for molding.

when splitting your weel, which is very symmetrical, isn't it possible to
split the face at the symmetry line using "difference" or "intersection" ?


when you very easily split your triangles into two bins when watching if
the z coordinate of the normal vector is pointing up or down.

For my tool i spent

25% of the time on finding the best cut line around the model
75% of the time to filling the big hole in the model which arises when
splitting the model into 2 halves ....

On Fri, Feb 24, 2023 at 2:29 PM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

I have a requirement to develop a casting mould for a part e.g. wheel.

All the surfaces which are visible from top needs to be extracted to get
one half of the mould.

Similarly surfaces which are visible from bottom needs to be extracted to
develop other side of the mould.

Parting lines can be zigzag depending on the part geometry.

Any ideas to do such a thing in openscad will be really helpful

Regards
Sanjeev


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


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

Hi Guenther Your picture of the split looks interesting. Can you give some more information on the workflow and the logic. In case it is possible to share the stltool developed by you, would be great, although i have very limited understanding of softwares. I started working on openscad as it initially looked simpler to work on. Then learnt a little bit of python to circumvent the limitations of openscad language. Now it seems I need to learn another one. Not sure if I will do that as it is taking a lot of my time. Anyway, I am not using it for any professional purposes and is a hobby. On Fri, 24 Feb, 2023, 7:15 pm Guenther Sohler, <guenther.sohler@gmail.com> wrote: > hi Sanjeev, > > I know exactly what you mean, I also do green-sand-casting and demolding > it *the* key for successful metal casting. > > I spent over 6 month on writing software to find the best split of a given > bust stl file programmatically. the tool is called "stltool" > > Right now developing the tool is on hold as I need some time for more > inspiration. > > Examples of successful splits are here: > > https://twitter.com/gadget_3d/status/1581385519308890112/photo/1 > > was also able to split "batman" mold successfully, but by far not all bust > are splittable for molding. > > when splitting your weel, which is very symmetrical, isn't it possible to > split the face at the symmetry line using "difference" or "intersection" ? > > -------- > when you very easily split your triangles into two bins when watching if > the z coordinate of the normal vector is pointing up or down. > > For my tool i spent > > 25% of the time on finding the best cut line around the model > 75% of the time to filling the big hole in the model which arises when > splitting the model into 2 halves .... > > > > > > > > On Fri, Feb 24, 2023 at 2:29 PM Sanjeev Prabhakar < > sprabhakar2006@gmail.com> wrote: > >> I have a requirement to develop a casting mould for a part e.g. wheel. >> >> All the surfaces which are visible from top needs to be extracted to get >> one half of the mould. >> >> Similarly surfaces which are visible from bottom needs to be extracted to >> develop other side of the mould. >> >> Parting lines can be zigzag depending on the part geometry. >> >> Any ideas to do such a thing in openscad will be really helpful >> >> Regards >> Sanjeev >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
GS
Guenther Sohler
Fri, Feb 24, 2023 2:23 PM

Hi Sanjeev,

stltool is coded in C and its a requirement to achieve the speed

stltool - moldsplit  main task is to split a model around the biggest
lateral extent(this is where faces-up meet faces-down)

A) Find starting point
this is easy: find the lateral point, which has biggest lateral distance
from the center
B) find cutline around model
from the starting point build a tree, only valid directions are edges
where edge-up meet edge-down
finally hoping you can surround the model in CCW direction and hopefully
hit the start point again
C) find out which triangles are "above" and "below" the cutline. this is
not necessarily the triangles with the normvector show up and down

D) duplicate all points at the culine and use them for bottom and upper
half respectively
E) finally move the objects apart by simply raising z coordinate of upper
half
F) now fill the big hole which arises when pulling the halves apart

  • simple polygon fill is not possible as the polygon might be concave
  • polygon tesselation is not possible because the points are in 3d, not 2d
  • finally i came up which an algoithm which offsets the polygon with
    negative values iteratively.
    at some point two corners melt into one. this is exaclty the required
    "helper point" to use to tesselate the polygon in a concave  - friendly way.
    (actually i believe this algorithm is very similar to openscad "roof"
    function.

Hope you got an idea, how the algorithm works, but i doubt you will make it
in python...

cheers

On Fri, Feb 24, 2023 at 3:07 PM Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

Hi Guenther

Your picture of the split looks interesting.

Can you give some more information on the workflow and the logic.

In case it is possible to share the stltool developed by you, would be
great, although i have very limited understanding of softwares.

I started working on openscad as it initially looked simpler to work on.

Then learnt a little bit of python to circumvent the limitations of
openscad language.

Now it seems I need to learn another one. Not sure if I will do that as it
is taking a lot of my time.

Anyway, I am not using it for any professional purposes and is a hobby.

On Fri, 24 Feb, 2023, 7:15 pm Guenther Sohler, guenther.sohler@gmail.com
wrote:

hi Sanjeev,

I know exactly what you mean, I also do green-sand-casting and demolding
it the key for successful metal casting.

I spent over 6 month on writing software to find the best split of a
given bust stl file programmatically. the tool is called "stltool"

Right now developing the tool is on hold as I need some time for more
inspiration.

Examples of successful splits are here:

https://twitter.com/gadget_3d/status/1581385519308890112/photo/1

was also able to split "batman" mold successfully, but by far not all
bust are splittable for molding.

when splitting your weel, which is very symmetrical, isn't it possible to
split the face at the symmetry line using "difference" or "intersection" ?


when you very easily split your triangles into two bins when watching if
the z coordinate of the normal vector is pointing up or down.

For my tool i spent

25% of the time on finding the best cut line around the model
75% of the time to filling the big hole in the model which arises when
splitting the model into 2 halves ....

On Fri, Feb 24, 2023 at 2:29 PM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

I have a requirement to develop a casting mould for a part e.g. wheel.

All the surfaces which are visible from top needs to be extracted to get
one half of the mould.

Similarly surfaces which are visible from bottom needs to be extracted
to develop other side of the mould.

Parting lines can be zigzag depending on the part geometry.

Any ideas to do such a thing in openscad will be really helpful

Regards
Sanjeev


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


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


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

Hi Sanjeev, stltool is coded in C and its a requirement to achieve the speed stltool - moldsplit main task is to split a model around the biggest lateral extent(this is where faces-up meet faces-down) A) Find starting point this is easy: find the lateral point, which has biggest lateral distance from the center B) find cutline around model from the starting point build a tree, only valid directions are edges where edge-up meet edge-down finally hoping you can surround the model in CCW direction and hopefully hit the start point again C) find out which triangles are "above" and "below" the cutline. this is not necessarily the triangles with the normvector show up and down D) duplicate all points at the culine and use them for bottom and upper half respectively E) finally move the objects apart by simply raising z coordinate of upper half F) now fill the big hole which arises when pulling the halves apart * simple polygon fill is not possible as the polygon might be concave * polygon tesselation is not possible because the points are in 3d, not 2d * finally i came up which an algoithm which offsets the polygon with negative values iteratively. at some point two corners melt into one. this is exaclty the required "helper point" to use to tesselate the polygon in a concave - friendly way. (actually i believe this algorithm is very similar to openscad "roof" function. Hope you got an idea, how the algorithm works, but i doubt you will make it in python... cheers On Fri, Feb 24, 2023 at 3:07 PM Sanjeev Prabhakar <sprabhakar2006@gmail.com> wrote: > Hi Guenther > > Your picture of the split looks interesting. > > Can you give some more information on the workflow and the logic. > > In case it is possible to share the stltool developed by you, would be > great, although i have very limited understanding of softwares. > > I started working on openscad as it initially looked simpler to work on. > > Then learnt a little bit of python to circumvent the limitations of > openscad language. > > Now it seems I need to learn another one. Not sure if I will do that as it > is taking a lot of my time. > > Anyway, I am not using it for any professional purposes and is a hobby. > > > > > > > > > > On Fri, 24 Feb, 2023, 7:15 pm Guenther Sohler, <guenther.sohler@gmail.com> > wrote: > >> hi Sanjeev, >> >> I know exactly what you mean, I also do green-sand-casting and demolding >> it *the* key for successful metal casting. >> >> I spent over 6 month on writing software to find the best split of a >> given bust stl file programmatically. the tool is called "stltool" >> >> Right now developing the tool is on hold as I need some time for more >> inspiration. >> >> Examples of successful splits are here: >> >> https://twitter.com/gadget_3d/status/1581385519308890112/photo/1 >> >> was also able to split "batman" mold successfully, but by far not all >> bust are splittable for molding. >> >> when splitting your weel, which is very symmetrical, isn't it possible to >> split the face at the symmetry line using "difference" or "intersection" ? >> >> -------- >> when you very easily split your triangles into two bins when watching if >> the z coordinate of the normal vector is pointing up or down. >> >> For my tool i spent >> >> 25% of the time on finding the best cut line around the model >> 75% of the time to filling the big hole in the model which arises when >> splitting the model into 2 halves .... >> >> >> >> >> >> >> >> On Fri, Feb 24, 2023 at 2:29 PM Sanjeev Prabhakar < >> sprabhakar2006@gmail.com> wrote: >> >>> I have a requirement to develop a casting mould for a part e.g. wheel. >>> >>> All the surfaces which are visible from top needs to be extracted to get >>> one half of the mould. >>> >>> Similarly surfaces which are visible from bottom needs to be extracted >>> to develop other side of the mould. >>> >>> Parting lines can be zigzag depending on the part geometry. >>> >>> Any ideas to do such a thing in openscad will be really helpful >>> >>> Regards >>> Sanjeev >>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
SP
Sanjeev Prabhakar
Fri, Feb 24, 2023 2:53 PM

These are good tips to find way out.

I will try this in my free time.

Thanks for suggestions

On Fri, 24 Feb, 2023, 7:54 pm Guenther Sohler, guenther.sohler@gmail.com
wrote:

Hi Sanjeev,

stltool is coded in C and its a requirement to achieve the speed

stltool - moldsplit  main task is to split a model around the biggest
lateral extent(this is where faces-up meet faces-down)

A) Find starting point
this is easy: find the lateral point, which has biggest lateral distance
from the center
B) find cutline around model
from the starting point build a tree, only valid directions are edges
where edge-up meet edge-down
finally hoping you can surround the model in CCW direction and hopefully
hit the start point again
C) find out which triangles are "above" and "below" the cutline. this is
not necessarily the triangles with the normvector show up and down

D) duplicate all points at the culine and use them for bottom and upper
half respectively
E) finally move the objects apart by simply raising z coordinate of upper
half
F) now fill the big hole which arises when pulling the halves apart

  • simple polygon fill is not possible as the polygon might be concave
  • polygon tesselation is not possible because the points are in 3d, not 2d
  • finally i came up which an algoithm which offsets the polygon with
    negative values iteratively.
    at some point two corners melt into one. this is exaclty the required
    "helper point" to use to tesselate the polygon in a concave  - friendly way.
    (actually i believe this algorithm is very similar to openscad "roof"
    function.

Hope you got an idea, how the algorithm works, but i doubt you will make
it in python...

cheers

On Fri, Feb 24, 2023 at 3:07 PM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

Hi Guenther

Your picture of the split looks interesting.

Can you give some more information on the workflow and the logic.

In case it is possible to share the stltool developed by you, would be
great, although i have very limited understanding of softwares.

I started working on openscad as it initially looked simpler to work on.

Then learnt a little bit of python to circumvent the limitations of
openscad language.

Now it seems I need to learn another one. Not sure if I will do that as
it is taking a lot of my time.

Anyway, I am not using it for any professional purposes and is a hobby.

On Fri, 24 Feb, 2023, 7:15 pm Guenther Sohler, guenther.sohler@gmail.com
wrote:

hi Sanjeev,

I know exactly what you mean, I also do green-sand-casting and demolding
it the key for successful metal casting.

I spent over 6 month on writing software to find the best split of a
given bust stl file programmatically. the tool is called "stltool"

Right now developing the tool is on hold as I need some time for more
inspiration.

Examples of successful splits are here:

https://twitter.com/gadget_3d/status/1581385519308890112/photo/1

was also able to split "batman" mold successfully, but by far not all
bust are splittable for molding.

when splitting your weel, which is very symmetrical, isn't it possible
to split the face at the symmetry line using "difference" or "intersection"
?


when you very easily split your triangles into two bins when watching if
the z coordinate of the normal vector is pointing up or down.

For my tool i spent

25% of the time on finding the best cut line around the model
75% of the time to filling the big hole in the model which arises when
splitting the model into 2 halves ....

On Fri, Feb 24, 2023 at 2:29 PM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

I have a requirement to develop a casting mould for a part e.g. wheel.

All the surfaces which are visible from top needs to be extracted to
get one half of the mould.

Similarly surfaces which are visible from bottom needs to be extracted
to develop other side of the mould.

Parting lines can be zigzag depending on the part geometry.

Any ideas to do such a thing in openscad will be really helpful

Regards
Sanjeev


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


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


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


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

These are good tips to find way out. I will try this in my free time. Thanks for suggestions On Fri, 24 Feb, 2023, 7:54 pm Guenther Sohler, <guenther.sohler@gmail.com> wrote: > Hi Sanjeev, > > stltool is coded in C and its a requirement to achieve the speed > > stltool - moldsplit main task is to split a model around the biggest > lateral extent(this is where faces-up meet faces-down) > > A) Find starting point > this is easy: find the lateral point, which has biggest lateral distance > from the center > B) find cutline around model > from the starting point build a tree, only valid directions are edges > where edge-up meet edge-down > finally hoping you can surround the model in CCW direction and hopefully > hit the start point again > C) find out which triangles are "above" and "below" the cutline. this is > not necessarily the triangles with the normvector show up and down > > D) duplicate all points at the culine and use them for bottom and upper > half respectively > E) finally move the objects apart by simply raising z coordinate of upper > half > F) now fill the big hole which arises when pulling the halves apart > * simple polygon fill is not possible as the polygon might be concave > * polygon tesselation is not possible because the points are in 3d, not 2d > * finally i came up which an algoithm which offsets the polygon with > negative values iteratively. > at some point two corners melt into one. this is exaclty the required > "helper point" to use to tesselate the polygon in a concave - friendly way. > (actually i believe this algorithm is very similar to openscad "roof" > function. > > Hope you got an idea, how the algorithm works, but i doubt you will make > it in python... > > cheers > > > > On Fri, Feb 24, 2023 at 3:07 PM Sanjeev Prabhakar < > sprabhakar2006@gmail.com> wrote: > >> Hi Guenther >> >> Your picture of the split looks interesting. >> >> Can you give some more information on the workflow and the logic. >> >> In case it is possible to share the stltool developed by you, would be >> great, although i have very limited understanding of softwares. >> >> I started working on openscad as it initially looked simpler to work on. >> >> Then learnt a little bit of python to circumvent the limitations of >> openscad language. >> >> Now it seems I need to learn another one. Not sure if I will do that as >> it is taking a lot of my time. >> >> Anyway, I am not using it for any professional purposes and is a hobby. >> >> >> >> >> >> >> >> >> >> On Fri, 24 Feb, 2023, 7:15 pm Guenther Sohler, <guenther.sohler@gmail.com> >> wrote: >> >>> hi Sanjeev, >>> >>> I know exactly what you mean, I also do green-sand-casting and demolding >>> it *the* key for successful metal casting. >>> >>> I spent over 6 month on writing software to find the best split of a >>> given bust stl file programmatically. the tool is called "stltool" >>> >>> Right now developing the tool is on hold as I need some time for more >>> inspiration. >>> >>> Examples of successful splits are here: >>> >>> https://twitter.com/gadget_3d/status/1581385519308890112/photo/1 >>> >>> was also able to split "batman" mold successfully, but by far not all >>> bust are splittable for molding. >>> >>> when splitting your weel, which is very symmetrical, isn't it possible >>> to split the face at the symmetry line using "difference" or "intersection" >>> ? >>> >>> -------- >>> when you very easily split your triangles into two bins when watching if >>> the z coordinate of the normal vector is pointing up or down. >>> >>> For my tool i spent >>> >>> 25% of the time on finding the best cut line around the model >>> 75% of the time to filling the big hole in the model which arises when >>> splitting the model into 2 halves .... >>> >>> >>> >>> >>> >>> >>> >>> On Fri, Feb 24, 2023 at 2:29 PM Sanjeev Prabhakar < >>> sprabhakar2006@gmail.com> wrote: >>> >>>> I have a requirement to develop a casting mould for a part e.g. wheel. >>>> >>>> All the surfaces which are visible from top needs to be extracted to >>>> get one half of the mould. >>>> >>>> Similarly surfaces which are visible from bottom needs to be extracted >>>> to develop other side of the mould. >>>> >>>> Parting lines can be zigzag depending on the part geometry. >>>> >>>> Any ideas to do such a thing in openscad will be really helpful >>>> >>>> Regards >>>> Sanjeev >>>> >>>> _______________________________________________ >>>> OpenSCAD mailing list >>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
DH
Daniel Harvey
Fri, Feb 24, 2023 3:07 PM

I haven't played with this problem myself, but is there a reason to not
have the algorithm decide a flat cut plane, and then find the triangles in
the stl that intersect this plane, and then cut these triangles into new
ones that are placed in the appropriate half? The intersection with a
triangular face in the model seems like it can only have three forms:

  1. coincident with a side, which is sort of like a non-intersection
    (triangle goes in one half)
  2. coincident with a corner, which then creates two triangles (one to each
    half)
  3. the else... will produce a triangle to go into one half, and a
    trapezoid... the trapezoid can be broken into two (or more) co-planar
    triangles.

Or just have the program suggest the best cut plane and let openscad handle
things using difference or intersection appropriately...?
In the case of the wheel, I'm not sure I understand why this is a challenge
(intersection with a cube where one face is the center line) - can you
explain?

On Fri, Feb 24, 2023 at 7:53 AM Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

These are good tips to find way out.

I will try this in my free time.

Thanks for suggestions

On Fri, 24 Feb, 2023, 7:54 pm Guenther Sohler, guenther.sohler@gmail.com
wrote:

Hi Sanjeev,

stltool is coded in C and its a requirement to achieve the speed

stltool - moldsplit  main task is to split a model around the biggest
lateral extent(this is where faces-up meet faces-down)

A) Find starting point
this is easy: find the lateral point, which has biggest lateral
distance from the center
B) find cutline around model
from the starting point build a tree, only valid directions are edges
where edge-up meet edge-down
finally hoping you can surround the model in CCW direction and hopefully
hit the start point again
C) find out which triangles are "above" and "below" the cutline. this is
not necessarily the triangles with the normvector show up and down

D) duplicate all points at the culine and use them for bottom and upper
half respectively
E) finally move the objects apart by simply raising z coordinate of upper
half
F) now fill the big hole which arises when pulling the halves apart

  • simple polygon fill is not possible as the polygon might be concave
  • polygon tesselation is not possible because the points are in 3d, not
    2d
  • finally i came up which an algoithm which offsets the polygon with
    negative values iteratively.
    at some point two corners melt into one. this is exaclty the required
    "helper point" to use to tesselate the polygon in a concave  - friendly way.
    (actually i believe this algorithm is very similar to openscad "roof"
    function.

Hope you got an idea, how the algorithm works, but i doubt you will make
it in python...

cheers

On Fri, Feb 24, 2023 at 3:07 PM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

Hi Guenther

Your picture of the split looks interesting.

Can you give some more information on the workflow and the logic.

In case it is possible to share the stltool developed by you, would be
great, although i have very limited understanding of softwares.

I started working on openscad as it initially looked simpler to work on.

Then learnt a little bit of python to circumvent the limitations of
openscad language.

Now it seems I need to learn another one. Not sure if I will do that as
it is taking a lot of my time.

Anyway, I am not using it for any professional purposes and is a hobby.

On Fri, 24 Feb, 2023, 7:15 pm Guenther Sohler, <
guenther.sohler@gmail.com> wrote:

hi Sanjeev,

I know exactly what you mean, I also do green-sand-casting and
demolding it the key for successful metal casting.

I spent over 6 month on writing software to find the best split of a
given bust stl file programmatically. the tool is called "stltool"

Right now developing the tool is on hold as I need some time for more
inspiration.

Examples of successful splits are here:

https://twitter.com/gadget_3d/status/1581385519308890112/photo/1

was also able to split "batman" mold successfully, but by far not all
bust are splittable for molding.

when splitting your weel, which is very symmetrical, isn't it possible
to split the face at the symmetry line using "difference" or "intersection"
?


when you very easily split your triangles into two bins when watching
if the z coordinate of the normal vector is pointing up or down.

For my tool i spent

25% of the time on finding the best cut line around the model
75% of the time to filling the big hole in the model which arises when
splitting the model into 2 halves ....

On Fri, Feb 24, 2023 at 2:29 PM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

I have a requirement to develop a casting mould for a part e.g. wheel.

All the surfaces which are visible from top needs to be extracted to
get one half of the mould.

Similarly surfaces which are visible from bottom needs to be extracted
to develop other side of the mould.

Parting lines can be zigzag depending on the part geometry.

Any ideas to do such a thing in openscad will be really helpful

Regards
Sanjeev


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


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


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


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


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

I haven't played with this problem myself, but is there a reason to not have the algorithm decide a flat cut plane, and then find the triangles in the stl that intersect this plane, and then cut these triangles into new ones that are placed in the appropriate half? The intersection with a triangular face in the model seems like it can only have three forms: 1) coincident with a side, which is sort of like a non-intersection (triangle goes in one half) 2) coincident with a corner, which then creates two triangles (one to each half) 3) the else... will produce a triangle to go into one half, and a trapezoid... the trapezoid can be broken into two (or more) co-planar triangles. Or just have the program suggest the best cut plane and let openscad handle things using difference or intersection appropriately...? In the case of the wheel, I'm not sure I understand why this is a challenge (intersection with a cube where one face is the center line) - can you explain? On Fri, Feb 24, 2023 at 7:53 AM Sanjeev Prabhakar <sprabhakar2006@gmail.com> wrote: > These are good tips to find way out. > > I will try this in my free time. > > Thanks for suggestions > > > On Fri, 24 Feb, 2023, 7:54 pm Guenther Sohler, <guenther.sohler@gmail.com> > wrote: > >> Hi Sanjeev, >> >> stltool is coded in C and its a requirement to achieve the speed >> >> stltool - moldsplit main task is to split a model around the biggest >> lateral extent(this is where faces-up meet faces-down) >> >> A) Find starting point >> this is easy: find the lateral point, which has biggest lateral >> distance from the center >> B) find cutline around model >> from the starting point build a tree, only valid directions are edges >> where edge-up meet edge-down >> finally hoping you can surround the model in CCW direction and hopefully >> hit the start point again >> C) find out which triangles are "above" and "below" the cutline. this is >> not necessarily the triangles with the normvector show up and down >> >> D) duplicate all points at the culine and use them for bottom and upper >> half respectively >> E) finally move the objects apart by simply raising z coordinate of upper >> half >> F) now fill the big hole which arises when pulling the halves apart >> * simple polygon fill is not possible as the polygon might be concave >> * polygon tesselation is not possible because the points are in 3d, not >> 2d >> * finally i came up which an algoithm which offsets the polygon with >> negative values iteratively. >> at some point two corners melt into one. this is exaclty the required >> "helper point" to use to tesselate the polygon in a concave - friendly way. >> (actually i believe this algorithm is very similar to openscad "roof" >> function. >> >> Hope you got an idea, how the algorithm works, but i doubt you will make >> it in python... >> >> cheers >> >> >> >> On Fri, Feb 24, 2023 at 3:07 PM Sanjeev Prabhakar < >> sprabhakar2006@gmail.com> wrote: >> >>> Hi Guenther >>> >>> Your picture of the split looks interesting. >>> >>> Can you give some more information on the workflow and the logic. >>> >>> In case it is possible to share the stltool developed by you, would be >>> great, although i have very limited understanding of softwares. >>> >>> I started working on openscad as it initially looked simpler to work on. >>> >>> Then learnt a little bit of python to circumvent the limitations of >>> openscad language. >>> >>> Now it seems I need to learn another one. Not sure if I will do that as >>> it is taking a lot of my time. >>> >>> Anyway, I am not using it for any professional purposes and is a hobby. >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> On Fri, 24 Feb, 2023, 7:15 pm Guenther Sohler, < >>> guenther.sohler@gmail.com> wrote: >>> >>>> hi Sanjeev, >>>> >>>> I know exactly what you mean, I also do green-sand-casting and >>>> demolding it *the* key for successful metal casting. >>>> >>>> I spent over 6 month on writing software to find the best split of a >>>> given bust stl file programmatically. the tool is called "stltool" >>>> >>>> Right now developing the tool is on hold as I need some time for more >>>> inspiration. >>>> >>>> Examples of successful splits are here: >>>> >>>> https://twitter.com/gadget_3d/status/1581385519308890112/photo/1 >>>> >>>> was also able to split "batman" mold successfully, but by far not all >>>> bust are splittable for molding. >>>> >>>> when splitting your weel, which is very symmetrical, isn't it possible >>>> to split the face at the symmetry line using "difference" or "intersection" >>>> ? >>>> >>>> -------- >>>> when you very easily split your triangles into two bins when watching >>>> if the z coordinate of the normal vector is pointing up or down. >>>> >>>> For my tool i spent >>>> >>>> 25% of the time on finding the best cut line around the model >>>> 75% of the time to filling the big hole in the model which arises when >>>> splitting the model into 2 halves .... >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> On Fri, Feb 24, 2023 at 2:29 PM Sanjeev Prabhakar < >>>> sprabhakar2006@gmail.com> wrote: >>>> >>>>> I have a requirement to develop a casting mould for a part e.g. wheel. >>>>> >>>>> All the surfaces which are visible from top needs to be extracted to >>>>> get one half of the mould. >>>>> >>>>> Similarly surfaces which are visible from bottom needs to be extracted >>>>> to develop other side of the mould. >>>>> >>>>> Parting lines can be zigzag depending on the part geometry. >>>>> >>>>> Any ideas to do such a thing in openscad will be really helpful >>>>> >>>>> Regards >>>>> Sanjeev >>>>> >>>>> _______________________________________________ >>>>> OpenSCAD mailing list >>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>>> >>>> _______________________________________________ >>>> OpenSCAD mailing list >>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
SP
Sanjeev Prabhakar
Fri, Feb 24, 2023 3:20 PM

you have spokes also which are not perfectly in center and the difference
doesn't work, due to the profile of the spokes.

Also if we need to work on this, it should be a generic solution as far as
possible which can be used elsewhere.

On Fri, 24 Feb 2023 at 20:38, Daniel Harvey dwaharvey@gmail.com wrote:

I haven't played with this problem myself, but is there a reason to not
have the algorithm decide a flat cut plane, and then find the triangles in
the stl that intersect this plane, and then cut these triangles into new
ones that are placed in the appropriate half? The intersection with a
triangular face in the model seems like it can only have three forms:

  1. coincident with a side, which is sort of like a non-intersection
    (triangle goes in one half)
  2. coincident with a corner, which then creates two triangles (one to each
    half)
  3. the else... will produce a triangle to go into one half, and a
    trapezoid... the trapezoid can be broken into two (or more) co-planar
    triangles.

Or just have the program suggest the best cut plane and let openscad
handle things using difference or intersection appropriately...?
In the case of the wheel, I'm not sure I understand why this is a
challenge (intersection with a cube where one face is the center line) -
can you explain?

On Fri, Feb 24, 2023 at 7:53 AM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

These are good tips to find way out.

I will try this in my free time.

Thanks for suggestions

On Fri, 24 Feb, 2023, 7:54 pm Guenther Sohler, guenther.sohler@gmail.com
wrote:

Hi Sanjeev,

stltool is coded in C and its a requirement to achieve the speed

stltool - moldsplit  main task is to split a model around the biggest
lateral extent(this is where faces-up meet faces-down)

A) Find starting point
this is easy: find the lateral point, which has biggest lateral
distance from the center
B) find cutline around model
from the starting point build a tree, only valid directions are edges
where edge-up meet edge-down
finally hoping you can surround the model in CCW direction and
hopefully hit the start point again
C) find out which triangles are "above" and "below" the cutline. this is
not necessarily the triangles with the normvector show up and down

D) duplicate all points at the culine and use them for bottom and upper
half respectively
E) finally move the objects apart by simply raising z coordinate of
upper half
F) now fill the big hole which arises when pulling the halves apart

  • simple polygon fill is not possible as the polygon might be concave
  • polygon tesselation is not possible because the points are in 3d, not
    2d
  • finally i came up which an algoithm which offsets the polygon with
    negative values iteratively.
    at some point two corners melt into one. this is exaclty the required
    "helper point" to use to tesselate the polygon in a concave  - friendly way.
    (actually i believe this algorithm is very similar to openscad "roof"
    function.

Hope you got an idea, how the algorithm works, but i doubt you will make
it in python...

cheers

On Fri, Feb 24, 2023 at 3:07 PM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

Hi Guenther

Your picture of the split looks interesting.

Can you give some more information on the workflow and the logic.

In case it is possible to share the stltool developed by you, would be
great, although i have very limited understanding of softwares.

I started working on openscad as it initially looked simpler to work on.

Then learnt a little bit of python to circumvent the limitations of
openscad language.

Now it seems I need to learn another one. Not sure if I will do that as
it is taking a lot of my time.

Anyway, I am not using it for any professional purposes and is a hobby.

On Fri, 24 Feb, 2023, 7:15 pm Guenther Sohler, <
guenther.sohler@gmail.com> wrote:

hi Sanjeev,

I know exactly what you mean, I also do green-sand-casting and
demolding it the key for successful metal casting.

I spent over 6 month on writing software to find the best split of a
given bust stl file programmatically. the tool is called "stltool"

Right now developing the tool is on hold as I need some time for more
inspiration.

Examples of successful splits are here:

https://twitter.com/gadget_3d/status/1581385519308890112/photo/1

was also able to split "batman" mold successfully, but by far not all
bust are splittable for molding.

when splitting your weel, which is very symmetrical, isn't it possible
to split the face at the symmetry line using "difference" or "intersection"
?


when you very easily split your triangles into two bins when watching
if the z coordinate of the normal vector is pointing up or down.

For my tool i spent

25% of the time on finding the best cut line around the model
75% of the time to filling the big hole in the model which arises when
splitting the model into 2 halves ....

On Fri, Feb 24, 2023 at 2:29 PM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

I have a requirement to develop a casting mould for a part e.g. wheel.

All the surfaces which are visible from top needs to be extracted to
get one half of the mould.

Similarly surfaces which are visible from bottom needs to be
extracted to develop other side of the mould.

Parting lines can be zigzag depending on the part geometry.

Any ideas to do such a thing in openscad will be really helpful

Regards
Sanjeev


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


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


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


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


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


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

you have spokes also which are not perfectly in center and the difference doesn't work, due to the profile of the spokes. Also if we need to work on this, it should be a generic solution as far as possible which can be used elsewhere. On Fri, 24 Feb 2023 at 20:38, Daniel Harvey <dwaharvey@gmail.com> wrote: > I haven't played with this problem myself, but is there a reason to not > have the algorithm decide a flat cut plane, and then find the triangles in > the stl that intersect this plane, and then cut these triangles into new > ones that are placed in the appropriate half? The intersection with a > triangular face in the model seems like it can only have three forms: > 1) coincident with a side, which is sort of like a non-intersection > (triangle goes in one half) > 2) coincident with a corner, which then creates two triangles (one to each > half) > 3) the else... will produce a triangle to go into one half, and a > trapezoid... the trapezoid can be broken into two (or more) co-planar > triangles. > > Or just have the program suggest the best cut plane and let openscad > handle things using difference or intersection appropriately...? > In the case of the wheel, I'm not sure I understand why this is a > challenge (intersection with a cube where one face is the center line) - > can you explain? > > On Fri, Feb 24, 2023 at 7:53 AM Sanjeev Prabhakar < > sprabhakar2006@gmail.com> wrote: > >> These are good tips to find way out. >> >> I will try this in my free time. >> >> Thanks for suggestions >> >> >> On Fri, 24 Feb, 2023, 7:54 pm Guenther Sohler, <guenther.sohler@gmail.com> >> wrote: >> >>> Hi Sanjeev, >>> >>> stltool is coded in C and its a requirement to achieve the speed >>> >>> stltool - moldsplit main task is to split a model around the biggest >>> lateral extent(this is where faces-up meet faces-down) >>> >>> A) Find starting point >>> this is easy: find the lateral point, which has biggest lateral >>> distance from the center >>> B) find cutline around model >>> from the starting point build a tree, only valid directions are edges >>> where edge-up meet edge-down >>> finally hoping you can surround the model in CCW direction and >>> hopefully hit the start point again >>> C) find out which triangles are "above" and "below" the cutline. this is >>> not necessarily the triangles with the normvector show up and down >>> >>> D) duplicate all points at the culine and use them for bottom and upper >>> half respectively >>> E) finally move the objects apart by simply raising z coordinate of >>> upper half >>> F) now fill the big hole which arises when pulling the halves apart >>> * simple polygon fill is not possible as the polygon might be concave >>> * polygon tesselation is not possible because the points are in 3d, not >>> 2d >>> * finally i came up which an algoithm which offsets the polygon with >>> negative values iteratively. >>> at some point two corners melt into one. this is exaclty the required >>> "helper point" to use to tesselate the polygon in a concave - friendly way. >>> (actually i believe this algorithm is very similar to openscad "roof" >>> function. >>> >>> Hope you got an idea, how the algorithm works, but i doubt you will make >>> it in python... >>> >>> cheers >>> >>> >>> >>> On Fri, Feb 24, 2023 at 3:07 PM Sanjeev Prabhakar < >>> sprabhakar2006@gmail.com> wrote: >>> >>>> Hi Guenther >>>> >>>> Your picture of the split looks interesting. >>>> >>>> Can you give some more information on the workflow and the logic. >>>> >>>> In case it is possible to share the stltool developed by you, would be >>>> great, although i have very limited understanding of softwares. >>>> >>>> I started working on openscad as it initially looked simpler to work on. >>>> >>>> Then learnt a little bit of python to circumvent the limitations of >>>> openscad language. >>>> >>>> Now it seems I need to learn another one. Not sure if I will do that as >>>> it is taking a lot of my time. >>>> >>>> Anyway, I am not using it for any professional purposes and is a hobby. >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> On Fri, 24 Feb, 2023, 7:15 pm Guenther Sohler, < >>>> guenther.sohler@gmail.com> wrote: >>>> >>>>> hi Sanjeev, >>>>> >>>>> I know exactly what you mean, I also do green-sand-casting and >>>>> demolding it *the* key for successful metal casting. >>>>> >>>>> I spent over 6 month on writing software to find the best split of a >>>>> given bust stl file programmatically. the tool is called "stltool" >>>>> >>>>> Right now developing the tool is on hold as I need some time for more >>>>> inspiration. >>>>> >>>>> Examples of successful splits are here: >>>>> >>>>> https://twitter.com/gadget_3d/status/1581385519308890112/photo/1 >>>>> >>>>> was also able to split "batman" mold successfully, but by far not all >>>>> bust are splittable for molding. >>>>> >>>>> when splitting your weel, which is very symmetrical, isn't it possible >>>>> to split the face at the symmetry line using "difference" or "intersection" >>>>> ? >>>>> >>>>> -------- >>>>> when you very easily split your triangles into two bins when watching >>>>> if the z coordinate of the normal vector is pointing up or down. >>>>> >>>>> For my tool i spent >>>>> >>>>> 25% of the time on finding the best cut line around the model >>>>> 75% of the time to filling the big hole in the model which arises when >>>>> splitting the model into 2 halves .... >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> On Fri, Feb 24, 2023 at 2:29 PM Sanjeev Prabhakar < >>>>> sprabhakar2006@gmail.com> wrote: >>>>> >>>>>> I have a requirement to develop a casting mould for a part e.g. wheel. >>>>>> >>>>>> All the surfaces which are visible from top needs to be extracted to >>>>>> get one half of the mould. >>>>>> >>>>>> Similarly surfaces which are visible from bottom needs to be >>>>>> extracted to develop other side of the mould. >>>>>> >>>>>> Parting lines can be zigzag depending on the part geometry. >>>>>> >>>>>> Any ideas to do such a thing in openscad will be really helpful >>>>>> >>>>>> Regards >>>>>> Sanjeev >>>>>> >>>>>> _______________________________________________ >>>>>> OpenSCAD mailing list >>>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>>>> >>>>> _______________________________________________ >>>>> OpenSCAD mailing list >>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>>> >>>> _______________________________________________ >>>> OpenSCAD mailing list >>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
GS
Guenther Sohler
Fri, Feb 24, 2023 3:20 PM

Hi Daniel,

In ideal case, a model like a wheel, is actually symmetrical around a flat
XY plane with 0 elevation at a certain z coordinate and fulfilling sanjeevs
task is just to
difference and to intersect with a big cube.

Unfortunately many models are not as easy as that. they have the point of
maximum lateral extent in differenz z heights.
If you still split such a model with a flat XY cut face, you could end up
in an upper mold which has faces which point downwards.

Did you browse youtube videos on green sand casting ? its very interesting.
if you do, you might get an idea why I came up with such a complicated
picture cut like in my first post.

On Fri, Feb 24, 2023 at 4:08 PM Daniel Harvey dwaharvey@gmail.com wrote:

I haven't played with this problem myself, but is there a reason to not
have the algorithm decide a flat cut plane, and then find the triangles in
the stl that intersect this plane, and then cut these triangles into new
ones that are placed in the appropriate half? The intersection with a
triangular face in the model seems like it can only have three forms:

  1. coincident with a side, which is sort of like a non-intersection
    (triangle goes in one half)
  2. coincident with a corner, which then creates two triangles (one to each
    half)
  3. the else... will produce a triangle to go into one half, and a
    trapezoid... the trapezoid can be broken into two (or more) co-planar
    triangles.

Or just have the program suggest the best cut plane and let openscad
handle things using difference or intersection appropriately...?
In the case of the wheel, I'm not sure I understand why this is a
challenge (intersection with a cube where one face is the center line) -
can you explain?

On Fri, Feb 24, 2023 at 7:53 AM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

These are good tips to find way out.

I will try this in my free time.

Thanks for suggestions

On Fri, 24 Feb, 2023, 7:54 pm Guenther Sohler, guenther.sohler@gmail.com
wrote:

Hi Sanjeev,

stltool is coded in C and its a requirement to achieve the speed

stltool - moldsplit  main task is to split a model around the biggest
lateral extent(this is where faces-up meet faces-down)

A) Find starting point
this is easy: find the lateral point, which has biggest lateral
distance from the center
B) find cutline around model
from the starting point build a tree, only valid directions are edges
where edge-up meet edge-down
finally hoping you can surround the model in CCW direction and
hopefully hit the start point again
C) find out which triangles are "above" and "below" the cutline. this is
not necessarily the triangles with the normvector show up and down

D) duplicate all points at the culine and use them for bottom and upper
half respectively
E) finally move the objects apart by simply raising z coordinate of
upper half
F) now fill the big hole which arises when pulling the halves apart

  • simple polygon fill is not possible as the polygon might be concave
  • polygon tesselation is not possible because the points are in 3d, not
    2d
  • finally i came up which an algoithm which offsets the polygon with
    negative values iteratively.
    at some point two corners melt into one. this is exaclty the required
    "helper point" to use to tesselate the polygon in a concave  - friendly way.
    (actually i believe this algorithm is very similar to openscad "roof"
    function.

Hope you got an idea, how the algorithm works, but i doubt you will make
it in python...

cheers

On Fri, Feb 24, 2023 at 3:07 PM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

Hi Guenther

Your picture of the split looks interesting.

Can you give some more information on the workflow and the logic.

In case it is possible to share the stltool developed by you, would be
great, although i have very limited understanding of softwares.

I started working on openscad as it initially looked simpler to work on.

Then learnt a little bit of python to circumvent the limitations of
openscad language.

Now it seems I need to learn another one. Not sure if I will do that as
it is taking a lot of my time.

Anyway, I am not using it for any professional purposes and is a hobby.

On Fri, 24 Feb, 2023, 7:15 pm Guenther Sohler, <
guenther.sohler@gmail.com> wrote:

hi Sanjeev,

I know exactly what you mean, I also do green-sand-casting and
demolding it the key for successful metal casting.

I spent over 6 month on writing software to find the best split of a
given bust stl file programmatically. the tool is called "stltool"

Right now developing the tool is on hold as I need some time for more
inspiration.

Examples of successful splits are here:

https://twitter.com/gadget_3d/status/1581385519308890112/photo/1

was also able to split "batman" mold successfully, but by far not all
bust are splittable for molding.

when splitting your weel, which is very symmetrical, isn't it possible
to split the face at the symmetry line using "difference" or "intersection"
?


when you very easily split your triangles into two bins when watching
if the z coordinate of the normal vector is pointing up or down.

For my tool i spent

25% of the time on finding the best cut line around the model
75% of the time to filling the big hole in the model which arises when
splitting the model into 2 halves ....

On Fri, Feb 24, 2023 at 2:29 PM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

I have a requirement to develop a casting mould for a part e.g. wheel.

All the surfaces which are visible from top needs to be extracted to
get one half of the mould.

Similarly surfaces which are visible from bottom needs to be
extracted to develop other side of the mould.

Parting lines can be zigzag depending on the part geometry.

Any ideas to do such a thing in openscad will be really helpful

Regards
Sanjeev


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


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


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


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


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


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

Hi Daniel, In ideal case, a model like a wheel, is actually symmetrical around a flat XY plane with 0 elevation at a certain z coordinate and fulfilling sanjeevs task is just to difference and to intersect with a big cube. Unfortunately many models are not as easy as that. they have the point of maximum lateral extent in differenz z heights. If you still split such a model with a flat XY cut face, you could end up in an upper mold which has faces which point downwards. Did you browse youtube videos on green sand casting ? its very interesting. if you do, you might get an idea why I came up with such a complicated picture cut like in my first post. On Fri, Feb 24, 2023 at 4:08 PM Daniel Harvey <dwaharvey@gmail.com> wrote: > I haven't played with this problem myself, but is there a reason to not > have the algorithm decide a flat cut plane, and then find the triangles in > the stl that intersect this plane, and then cut these triangles into new > ones that are placed in the appropriate half? The intersection with a > triangular face in the model seems like it can only have three forms: > 1) coincident with a side, which is sort of like a non-intersection > (triangle goes in one half) > 2) coincident with a corner, which then creates two triangles (one to each > half) > 3) the else... will produce a triangle to go into one half, and a > trapezoid... the trapezoid can be broken into two (or more) co-planar > triangles. > > Or just have the program suggest the best cut plane and let openscad > handle things using difference or intersection appropriately...? > In the case of the wheel, I'm not sure I understand why this is a > challenge (intersection with a cube where one face is the center line) - > can you explain? > > On Fri, Feb 24, 2023 at 7:53 AM Sanjeev Prabhakar < > sprabhakar2006@gmail.com> wrote: > >> These are good tips to find way out. >> >> I will try this in my free time. >> >> Thanks for suggestions >> >> >> On Fri, 24 Feb, 2023, 7:54 pm Guenther Sohler, <guenther.sohler@gmail.com> >> wrote: >> >>> Hi Sanjeev, >>> >>> stltool is coded in C and its a requirement to achieve the speed >>> >>> stltool - moldsplit main task is to split a model around the biggest >>> lateral extent(this is where faces-up meet faces-down) >>> >>> A) Find starting point >>> this is easy: find the lateral point, which has biggest lateral >>> distance from the center >>> B) find cutline around model >>> from the starting point build a tree, only valid directions are edges >>> where edge-up meet edge-down >>> finally hoping you can surround the model in CCW direction and >>> hopefully hit the start point again >>> C) find out which triangles are "above" and "below" the cutline. this is >>> not necessarily the triangles with the normvector show up and down >>> >>> D) duplicate all points at the culine and use them for bottom and upper >>> half respectively >>> E) finally move the objects apart by simply raising z coordinate of >>> upper half >>> F) now fill the big hole which arises when pulling the halves apart >>> * simple polygon fill is not possible as the polygon might be concave >>> * polygon tesselation is not possible because the points are in 3d, not >>> 2d >>> * finally i came up which an algoithm which offsets the polygon with >>> negative values iteratively. >>> at some point two corners melt into one. this is exaclty the required >>> "helper point" to use to tesselate the polygon in a concave - friendly way. >>> (actually i believe this algorithm is very similar to openscad "roof" >>> function. >>> >>> Hope you got an idea, how the algorithm works, but i doubt you will make >>> it in python... >>> >>> cheers >>> >>> >>> >>> On Fri, Feb 24, 2023 at 3:07 PM Sanjeev Prabhakar < >>> sprabhakar2006@gmail.com> wrote: >>> >>>> Hi Guenther >>>> >>>> Your picture of the split looks interesting. >>>> >>>> Can you give some more information on the workflow and the logic. >>>> >>>> In case it is possible to share the stltool developed by you, would be >>>> great, although i have very limited understanding of softwares. >>>> >>>> I started working on openscad as it initially looked simpler to work on. >>>> >>>> Then learnt a little bit of python to circumvent the limitations of >>>> openscad language. >>>> >>>> Now it seems I need to learn another one. Not sure if I will do that as >>>> it is taking a lot of my time. >>>> >>>> Anyway, I am not using it for any professional purposes and is a hobby. >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> On Fri, 24 Feb, 2023, 7:15 pm Guenther Sohler, < >>>> guenther.sohler@gmail.com> wrote: >>>> >>>>> hi Sanjeev, >>>>> >>>>> I know exactly what you mean, I also do green-sand-casting and >>>>> demolding it *the* key for successful metal casting. >>>>> >>>>> I spent over 6 month on writing software to find the best split of a >>>>> given bust stl file programmatically. the tool is called "stltool" >>>>> >>>>> Right now developing the tool is on hold as I need some time for more >>>>> inspiration. >>>>> >>>>> Examples of successful splits are here: >>>>> >>>>> https://twitter.com/gadget_3d/status/1581385519308890112/photo/1 >>>>> >>>>> was also able to split "batman" mold successfully, but by far not all >>>>> bust are splittable for molding. >>>>> >>>>> when splitting your weel, which is very symmetrical, isn't it possible >>>>> to split the face at the symmetry line using "difference" or "intersection" >>>>> ? >>>>> >>>>> -------- >>>>> when you very easily split your triangles into two bins when watching >>>>> if the z coordinate of the normal vector is pointing up or down. >>>>> >>>>> For my tool i spent >>>>> >>>>> 25% of the time on finding the best cut line around the model >>>>> 75% of the time to filling the big hole in the model which arises when >>>>> splitting the model into 2 halves .... >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> On Fri, Feb 24, 2023 at 2:29 PM Sanjeev Prabhakar < >>>>> sprabhakar2006@gmail.com> wrote: >>>>> >>>>>> I have a requirement to develop a casting mould for a part e.g. wheel. >>>>>> >>>>>> All the surfaces which are visible from top needs to be extracted to >>>>>> get one half of the mould. >>>>>> >>>>>> Similarly surfaces which are visible from bottom needs to be >>>>>> extracted to develop other side of the mould. >>>>>> >>>>>> Parting lines can be zigzag depending on the part geometry. >>>>>> >>>>>> Any ideas to do such a thing in openscad will be really helpful >>>>>> >>>>>> Regards >>>>>> Sanjeev >>>>>> >>>>>> _______________________________________________ >>>>>> OpenSCAD mailing list >>>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>>>> >>>>> _______________________________________________ >>>>> OpenSCAD mailing list >>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>>> >>>> _______________________________________________ >>>> OpenSCAD mailing list >>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
DH
Daniel Harvey
Fri, Feb 24, 2023 3:47 PM

Hi Guenther,
In everything I have seen, an inprint is made in each of two halves, and
the halves are assembled together (with imprinting objects removed) and the
resulting mold is filled with a liquid that sets. But in all these cases
the two halves basically have a flat intersection face.  In the example of
your Gollum bust, how are the two halves with the non-flat faces turned
into a mold? Also it seems like there would be many objects that could not
be handled at all - objects where there is no cutline that doesn't create a
situation with  an upward pointing face that is shadowed by a downward
pointing one.

On Fri, Feb 24, 2023 at 8:22 AM Guenther Sohler guenther.sohler@gmail.com
wrote:

Hi Daniel,

In ideal case, a model like a wheel, is actually symmetrical around a flat
XY plane with 0 elevation at a certain z coordinate and fulfilling sanjeevs
task is just to
difference and to intersect with a big cube.

Unfortunately many models are not as easy as that. they have the point of
maximum lateral extent in differenz z heights.
If you still split such a model with a flat XY cut face, you could end up
in an upper mold which has faces which point downwards.

Did you browse youtube videos on green sand casting ? its very
interesting. if you do, you might get an idea why I came up with such a
complicated picture cut like in my first post.

On Fri, Feb 24, 2023 at 4:08 PM Daniel Harvey dwaharvey@gmail.com wrote:

I haven't played with this problem myself, but is there a reason to not
have the algorithm decide a flat cut plane, and then find the triangles in
the stl that intersect this plane, and then cut these triangles into new
ones that are placed in the appropriate half? The intersection with a
triangular face in the model seems like it can only have three forms:

  1. coincident with a side, which is sort of like a non-intersection
    (triangle goes in one half)
  2. coincident with a corner, which then creates two triangles (one to
    each half)
  3. the else... will produce a triangle to go into one half, and a
    trapezoid... the trapezoid can be broken into two (or more) co-planar
    triangles.

Or just have the program suggest the best cut plane and let openscad
handle things using difference or intersection appropriately...?
In the case of the wheel, I'm not sure I understand why this is a
challenge (intersection with a cube where one face is the center line) -
can you explain?

On Fri, Feb 24, 2023 at 7:53 AM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

These are good tips to find way out.

I will try this in my free time.

Thanks for suggestions

On Fri, 24 Feb, 2023, 7:54 pm Guenther Sohler, <
guenther.sohler@gmail.com> wrote:

Hi Sanjeev,

stltool is coded in C and its a requirement to achieve the speed

stltool - moldsplit  main task is to split a model around the biggest
lateral extent(this is where faces-up meet faces-down)

A) Find starting point
this is easy: find the lateral point, which has biggest lateral
distance from the center
B) find cutline around model
from the starting point build a tree, only valid directions are edges
where edge-up meet edge-down
finally hoping you can surround the model in CCW direction and
hopefully hit the start point again
C) find out which triangles are "above" and "below" the cutline. this
is not necessarily the triangles with the normvector show up and down

D) duplicate all points at the culine and use them for bottom and upper
half respectively
E) finally move the objects apart by simply raising z coordinate of
upper half
F) now fill the big hole which arises when pulling the halves apart

  • simple polygon fill is not possible as the polygon might be concave
  • polygon tesselation is not possible because the points are in 3d,
    not 2d
  • finally i came up which an algoithm which offsets the polygon with
    negative values iteratively.
    at some point two corners melt into one. this is exaclty the
    required "helper point" to use to tesselate the polygon in a concave  -
    friendly way.
    (actually i believe this algorithm is very similar to openscad
    "roof"  function.

Hope you got an idea, how the algorithm works, but i doubt you will
make it in python...

cheers

On Fri, Feb 24, 2023 at 3:07 PM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

Hi Guenther

Your picture of the split looks interesting.

Can you give some more information on the workflow and the logic.

In case it is possible to share the stltool developed by you, would be
great, although i have very limited understanding of softwares.

I started working on openscad as it initially looked simpler to work
on.

Then learnt a little bit of python to circumvent the limitations of
openscad language.

Now it seems I need to learn another one. Not sure if I will do that
as it is taking a lot of my time.

Anyway, I am not using it for any professional purposes and is a hobby.

On Fri, 24 Feb, 2023, 7:15 pm Guenther Sohler, <
guenther.sohler@gmail.com> wrote:

hi Sanjeev,

I know exactly what you mean, I also do green-sand-casting and
demolding it the key for successful metal casting.

I spent over 6 month on writing software to find the best split of a
given bust stl file programmatically. the tool is called "stltool"

Right now developing the tool is on hold as I need some time for more
inspiration.

Examples of successful splits are here:

https://twitter.com/gadget_3d/status/1581385519308890112/photo/1

was also able to split "batman" mold successfully, but by far not all
bust are splittable for molding.

when splitting your weel, which is very symmetrical, isn't it
possible to split the face at the symmetry line using "difference" or
"intersection" ?


when you very easily split your triangles into two bins when watching
if the z coordinate of the normal vector is pointing up or down.

For my tool i spent

25% of the time on finding the best cut line around the model
75% of the time to filling the big hole in the model which arises
when splitting the model into 2 halves ....

On Fri, Feb 24, 2023 at 2:29 PM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

I have a requirement to develop a casting mould for a part e.g.
wheel.

All the surfaces which are visible from top needs to be extracted to
get one half of the mould.

Similarly surfaces which are visible from bottom needs to be
extracted to develop other side of the mould.

Parting lines can be zigzag depending on the part geometry.

Any ideas to do such a thing in openscad will be really helpful

Regards
Sanjeev


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


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


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


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


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


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


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

Hi Guenther, In everything I have seen, an inprint is made in each of two halves, and the halves are assembled together (with imprinting objects removed) and the resulting mold is filled with a liquid that sets. But in all these cases the two halves basically have a flat intersection face. In the example of your Gollum bust, how are the two halves with the non-flat faces turned into a mold? Also it seems like there would be many objects that could not be handled at all - objects where there is no cutline that doesn't create a situation with an upward pointing face that is shadowed by a downward pointing one. On Fri, Feb 24, 2023 at 8:22 AM Guenther Sohler <guenther.sohler@gmail.com> wrote: > Hi Daniel, > > In ideal case, a model like a wheel, is actually symmetrical around a flat > XY plane with 0 elevation at a certain z coordinate and fulfilling sanjeevs > task is just to > difference and to intersect with a big cube. > > Unfortunately many models are not as easy as that. they have the point of > maximum lateral extent in differenz z heights. > If you still split such a model with a flat XY cut face, you could end up > in an upper mold which has faces which point downwards. > > Did you browse youtube videos on green sand casting ? its very > interesting. if you do, you might get an idea why I came up with such a > complicated picture cut like in my first post. > > > > On Fri, Feb 24, 2023 at 4:08 PM Daniel Harvey <dwaharvey@gmail.com> wrote: > >> I haven't played with this problem myself, but is there a reason to not >> have the algorithm decide a flat cut plane, and then find the triangles in >> the stl that intersect this plane, and then cut these triangles into new >> ones that are placed in the appropriate half? The intersection with a >> triangular face in the model seems like it can only have three forms: >> 1) coincident with a side, which is sort of like a non-intersection >> (triangle goes in one half) >> 2) coincident with a corner, which then creates two triangles (one to >> each half) >> 3) the else... will produce a triangle to go into one half, and a >> trapezoid... the trapezoid can be broken into two (or more) co-planar >> triangles. >> >> Or just have the program suggest the best cut plane and let openscad >> handle things using difference or intersection appropriately...? >> In the case of the wheel, I'm not sure I understand why this is a >> challenge (intersection with a cube where one face is the center line) - >> can you explain? >> >> On Fri, Feb 24, 2023 at 7:53 AM Sanjeev Prabhakar < >> sprabhakar2006@gmail.com> wrote: >> >>> These are good tips to find way out. >>> >>> I will try this in my free time. >>> >>> Thanks for suggestions >>> >>> >>> On Fri, 24 Feb, 2023, 7:54 pm Guenther Sohler, < >>> guenther.sohler@gmail.com> wrote: >>> >>>> Hi Sanjeev, >>>> >>>> stltool is coded in C and its a requirement to achieve the speed >>>> >>>> stltool - moldsplit main task is to split a model around the biggest >>>> lateral extent(this is where faces-up meet faces-down) >>>> >>>> A) Find starting point >>>> this is easy: find the lateral point, which has biggest lateral >>>> distance from the center >>>> B) find cutline around model >>>> from the starting point build a tree, only valid directions are edges >>>> where edge-up meet edge-down >>>> finally hoping you can surround the model in CCW direction and >>>> hopefully hit the start point again >>>> C) find out which triangles are "above" and "below" the cutline. this >>>> is not necessarily the triangles with the normvector show up and down >>>> >>>> D) duplicate all points at the culine and use them for bottom and upper >>>> half respectively >>>> E) finally move the objects apart by simply raising z coordinate of >>>> upper half >>>> F) now fill the big hole which arises when pulling the halves apart >>>> * simple polygon fill is not possible as the polygon might be concave >>>> * polygon tesselation is not possible because the points are in 3d, >>>> not 2d >>>> * finally i came up which an algoithm which offsets the polygon with >>>> negative values iteratively. >>>> at some point two corners melt into one. this is exaclty the >>>> required "helper point" to use to tesselate the polygon in a concave - >>>> friendly way. >>>> (actually i believe this algorithm is very similar to openscad >>>> "roof" function. >>>> >>>> Hope you got an idea, how the algorithm works, but i doubt you will >>>> make it in python... >>>> >>>> cheers >>>> >>>> >>>> >>>> On Fri, Feb 24, 2023 at 3:07 PM Sanjeev Prabhakar < >>>> sprabhakar2006@gmail.com> wrote: >>>> >>>>> Hi Guenther >>>>> >>>>> Your picture of the split looks interesting. >>>>> >>>>> Can you give some more information on the workflow and the logic. >>>>> >>>>> In case it is possible to share the stltool developed by you, would be >>>>> great, although i have very limited understanding of softwares. >>>>> >>>>> I started working on openscad as it initially looked simpler to work >>>>> on. >>>>> >>>>> Then learnt a little bit of python to circumvent the limitations of >>>>> openscad language. >>>>> >>>>> Now it seems I need to learn another one. Not sure if I will do that >>>>> as it is taking a lot of my time. >>>>> >>>>> Anyway, I am not using it for any professional purposes and is a hobby. >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> On Fri, 24 Feb, 2023, 7:15 pm Guenther Sohler, < >>>>> guenther.sohler@gmail.com> wrote: >>>>> >>>>>> hi Sanjeev, >>>>>> >>>>>> I know exactly what you mean, I also do green-sand-casting and >>>>>> demolding it *the* key for successful metal casting. >>>>>> >>>>>> I spent over 6 month on writing software to find the best split of a >>>>>> given bust stl file programmatically. the tool is called "stltool" >>>>>> >>>>>> Right now developing the tool is on hold as I need some time for more >>>>>> inspiration. >>>>>> >>>>>> Examples of successful splits are here: >>>>>> >>>>>> https://twitter.com/gadget_3d/status/1581385519308890112/photo/1 >>>>>> >>>>>> was also able to split "batman" mold successfully, but by far not all >>>>>> bust are splittable for molding. >>>>>> >>>>>> when splitting your weel, which is very symmetrical, isn't it >>>>>> possible to split the face at the symmetry line using "difference" or >>>>>> "intersection" ? >>>>>> >>>>>> -------- >>>>>> when you very easily split your triangles into two bins when watching >>>>>> if the z coordinate of the normal vector is pointing up or down. >>>>>> >>>>>> For my tool i spent >>>>>> >>>>>> 25% of the time on finding the best cut line around the model >>>>>> 75% of the time to filling the big hole in the model which arises >>>>>> when splitting the model into 2 halves .... >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Fri, Feb 24, 2023 at 2:29 PM Sanjeev Prabhakar < >>>>>> sprabhakar2006@gmail.com> wrote: >>>>>> >>>>>>> I have a requirement to develop a casting mould for a part e.g. >>>>>>> wheel. >>>>>>> >>>>>>> All the surfaces which are visible from top needs to be extracted to >>>>>>> get one half of the mould. >>>>>>> >>>>>>> Similarly surfaces which are visible from bottom needs to be >>>>>>> extracted to develop other side of the mould. >>>>>>> >>>>>>> Parting lines can be zigzag depending on the part geometry. >>>>>>> >>>>>>> Any ideas to do such a thing in openscad will be really helpful >>>>>>> >>>>>>> Regards >>>>>>> Sanjeev >>>>>>> >>>>>>> _______________________________________________ >>>>>>> OpenSCAD mailing list >>>>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>>>>> >>>>>> _______________________________________________ >>>>>> OpenSCAD mailing list >>>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>>>> >>>>> _______________________________________________ >>>>> OpenSCAD mailing list >>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>>> >>>> _______________________________________________ >>>> OpenSCAD mailing list >>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
GS
Guenther Sohler
Fri, Feb 24, 2023 4:06 PM

Hi Daniel,

Maybe you have  only seen mold halves with a flat cutline, because
the models werd specially designed to have a flat cutline ?
(or nobody has managed to split models with a non-planar cutline ? )
But you are right.
Cutting an object into 2  halves can be a challenge. Finding out that the
gollum bust has an issue to demold i only found out after  I managed to
retrieve the cutline.
(between the ears and the neck)
Also I doubt that the gollum bust can be demolded with a flat cutline.
Generally I believe it's quite hard to find busts on Thingiverse which can
easily be split for demolding.

But  I was successfully able to split batman.

https://cults3d.com/en/3d-model/art/batman-bust-ready-for-sandcast-molding

When you look at the splitted parts separated, you might understand, why a
flat cutline would not work out

Just for interest, do you  have some experience with sand casting ?

On Fri, Feb 24, 2023 at 4:48 PM Daniel Harvey dwaharvey@gmail.com wrote:

Hi Guenther,
In everything I have seen, an inprint is made in each of two halves, and
the halves are assembled together (with imprinting objects removed) and the
resulting mold is filled with a liquid that sets. But in all these cases
the two halves basically have a flat intersection face.  In the example of
your Gollum bust, how are the two halves with the non-flat faces turned
into a mold? Also it seems like there would be many objects that could not
be handled at all - objects where there is no cutline that doesn't create a
situation with  an upward pointing face that is shadowed by a downward
pointing one.

On Fri, Feb 24, 2023 at 8:22 AM Guenther Sohler guenther.sohler@gmail.com
wrote:

Hi Daniel,

In ideal case, a model like a wheel, is actually symmetrical around a
flat XY plane with 0 elevation at a certain z coordinate and fulfilling
sanjeevs task is just to
difference and to intersect with a big cube.

Unfortunately many models are not as easy as that. they have the point of
maximum lateral extent in differenz z heights.
If you still split such a model with a flat XY cut face, you could end up
in an upper mold which has faces which point downwards.

Did you browse youtube videos on green sand casting ? its very
interesting. if you do, you might get an idea why I came up with such a
complicated picture cut like in my first post.

On Fri, Feb 24, 2023 at 4:08 PM Daniel Harvey dwaharvey@gmail.com
wrote:

I haven't played with this problem myself, but is there a reason to not
have the algorithm decide a flat cut plane, and then find the triangles in
the stl that intersect this plane, and then cut these triangles into new
ones that are placed in the appropriate half? The intersection with a
triangular face in the model seems like it can only have three forms:

  1. coincident with a side, which is sort of like a non-intersection
    (triangle goes in one half)
  2. coincident with a corner, which then creates two triangles (one to
    each half)
  3. the else... will produce a triangle to go into one half, and a
    trapezoid... the trapezoid can be broken into two (or more) co-planar
    triangles.

Or just have the program suggest the best cut plane and let openscad
handle things using difference or intersection appropriately...?
In the case of the wheel, I'm not sure I understand why this is a
challenge (intersection with a cube where one face is the center line) -
can you explain?

On Fri, Feb 24, 2023 at 7:53 AM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

These are good tips to find way out.

I will try this in my free time.

Thanks for suggestions

On Fri, 24 Feb, 2023, 7:54 pm Guenther Sohler, <
guenther.sohler@gmail.com> wrote:

Hi Sanjeev,

stltool is coded in C and its a requirement to achieve the speed

stltool - moldsplit  main task is to split a model around the biggest
lateral extent(this is where faces-up meet faces-down)

A) Find starting point
this is easy: find the lateral point, which has biggest lateral
distance from the center
B) find cutline around model
from the starting point build a tree, only valid directions are
edges where edge-up meet edge-down
finally hoping you can surround the model in CCW direction and
hopefully hit the start point again
C) find out which triangles are "above" and "below" the cutline. this
is not necessarily the triangles with the normvector show up and down

D) duplicate all points at the culine and use them for bottom and
upper half respectively
E) finally move the objects apart by simply raising z coordinate of
upper half
F) now fill the big hole which arises when pulling the halves apart

  • simple polygon fill is not possible as the polygon might be concave
  • polygon tesselation is not possible because the points are in 3d,
    not 2d
  • finally i came up which an algoithm which offsets the polygon with
    negative values iteratively.
    at some point two corners melt into one. this is exaclty the
    required "helper point" to use to tesselate the polygon in a concave  -
    friendly way.
    (actually i believe this algorithm is very similar to openscad
    "roof"  function.

Hope you got an idea, how the algorithm works, but i doubt you will
make it in python...

cheers

On Fri, Feb 24, 2023 at 3:07 PM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

Hi Guenther

Your picture of the split looks interesting.

Can you give some more information on the workflow and the logic.

In case it is possible to share the stltool developed by you, would
be great, although i have very limited understanding of softwares.

I started working on openscad as it initially looked simpler to work
on.

Then learnt a little bit of python to circumvent the limitations of
openscad language.

Now it seems I need to learn another one. Not sure if I will do that
as it is taking a lot of my time.

Anyway, I am not using it for any professional purposes and is a
hobby.

On Fri, 24 Feb, 2023, 7:15 pm Guenther Sohler, <
guenther.sohler@gmail.com> wrote:

hi Sanjeev,

I know exactly what you mean, I also do green-sand-casting and
demolding it the key for successful metal casting.

I spent over 6 month on writing software to find the best split of a
given bust stl file programmatically. the tool is called "stltool"

Right now developing the tool is on hold as I need some time for
more inspiration.

Examples of successful splits are here:

https://twitter.com/gadget_3d/status/1581385519308890112/photo/1

was also able to split "batman" mold successfully, but by far not
all bust are splittable for molding.

when splitting your weel, which is very symmetrical, isn't it
possible to split the face at the symmetry line using "difference" or
"intersection" ?


when you very easily split your triangles into two bins when
watching if the z coordinate of the normal vector is pointing up or down.

For my tool i spent

25% of the time on finding the best cut line around the model
75% of the time to filling the big hole in the model which arises
when splitting the model into 2 halves ....

On Fri, Feb 24, 2023 at 2:29 PM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

I have a requirement to develop a casting mould for a part e.g.
wheel.

All the surfaces which are visible from top needs to be extracted
to get one half of the mould.

Similarly surfaces which are visible from bottom needs to be
extracted to develop other side of the mould.

Parting lines can be zigzag depending on the part geometry.

Any ideas to do such a thing in openscad will be really helpful

Regards
Sanjeev


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


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


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


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


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


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


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


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

Hi Daniel, Maybe you have only seen mold halves with a flat cutline, because the models werd specially designed to have a flat cutline ? (or nobody has managed to split models with a non-planar cutline ? ) But you are right. Cutting an object into 2 halves can be a challenge. Finding out that the gollum bust has an issue to demold i only found out after I managed to retrieve the cutline. (between the ears and the neck) Also I doubt that the gollum bust can be demolded with a flat cutline. Generally I believe it's quite hard to find busts on Thingiverse which can easily be split for demolding. But I was successfully able to split batman. https://cults3d.com/en/3d-model/art/batman-bust-ready-for-sandcast-molding When you look at the splitted parts separated, you might understand, why a flat cutline would not work out Just for interest, do you have some experience with sand casting ? On Fri, Feb 24, 2023 at 4:48 PM Daniel Harvey <dwaharvey@gmail.com> wrote: > Hi Guenther, > In everything I have seen, an inprint is made in each of two halves, and > the halves are assembled together (with imprinting objects removed) and the > resulting mold is filled with a liquid that sets. But in all these cases > the two halves basically have a flat intersection face. In the example of > your Gollum bust, how are the two halves with the non-flat faces turned > into a mold? Also it seems like there would be many objects that could not > be handled at all - objects where there is no cutline that doesn't create a > situation with an upward pointing face that is shadowed by a downward > pointing one. > > On Fri, Feb 24, 2023 at 8:22 AM Guenther Sohler <guenther.sohler@gmail.com> > wrote: > >> Hi Daniel, >> >> In ideal case, a model like a wheel, is actually symmetrical around a >> flat XY plane with 0 elevation at a certain z coordinate and fulfilling >> sanjeevs task is just to >> difference and to intersect with a big cube. >> >> Unfortunately many models are not as easy as that. they have the point of >> maximum lateral extent in differenz z heights. >> If you still split such a model with a flat XY cut face, you could end up >> in an upper mold which has faces which point downwards. >> >> Did you browse youtube videos on green sand casting ? its very >> interesting. if you do, you might get an idea why I came up with such a >> complicated picture cut like in my first post. >> >> >> >> On Fri, Feb 24, 2023 at 4:08 PM Daniel Harvey <dwaharvey@gmail.com> >> wrote: >> >>> I haven't played with this problem myself, but is there a reason to not >>> have the algorithm decide a flat cut plane, and then find the triangles in >>> the stl that intersect this plane, and then cut these triangles into new >>> ones that are placed in the appropriate half? The intersection with a >>> triangular face in the model seems like it can only have three forms: >>> 1) coincident with a side, which is sort of like a non-intersection >>> (triangle goes in one half) >>> 2) coincident with a corner, which then creates two triangles (one to >>> each half) >>> 3) the else... will produce a triangle to go into one half, and a >>> trapezoid... the trapezoid can be broken into two (or more) co-planar >>> triangles. >>> >>> Or just have the program suggest the best cut plane and let openscad >>> handle things using difference or intersection appropriately...? >>> In the case of the wheel, I'm not sure I understand why this is a >>> challenge (intersection with a cube where one face is the center line) - >>> can you explain? >>> >>> On Fri, Feb 24, 2023 at 7:53 AM Sanjeev Prabhakar < >>> sprabhakar2006@gmail.com> wrote: >>> >>>> These are good tips to find way out. >>>> >>>> I will try this in my free time. >>>> >>>> Thanks for suggestions >>>> >>>> >>>> On Fri, 24 Feb, 2023, 7:54 pm Guenther Sohler, < >>>> guenther.sohler@gmail.com> wrote: >>>> >>>>> Hi Sanjeev, >>>>> >>>>> stltool is coded in C and its a requirement to achieve the speed >>>>> >>>>> stltool - moldsplit main task is to split a model around the biggest >>>>> lateral extent(this is where faces-up meet faces-down) >>>>> >>>>> A) Find starting point >>>>> this is easy: find the lateral point, which has biggest lateral >>>>> distance from the center >>>>> B) find cutline around model >>>>> from the starting point build a tree, only valid directions are >>>>> edges where edge-up meet edge-down >>>>> finally hoping you can surround the model in CCW direction and >>>>> hopefully hit the start point again >>>>> C) find out which triangles are "above" and "below" the cutline. this >>>>> is not necessarily the triangles with the normvector show up and down >>>>> >>>>> D) duplicate all points at the culine and use them for bottom and >>>>> upper half respectively >>>>> E) finally move the objects apart by simply raising z coordinate of >>>>> upper half >>>>> F) now fill the big hole which arises when pulling the halves apart >>>>> * simple polygon fill is not possible as the polygon might be concave >>>>> * polygon tesselation is not possible because the points are in 3d, >>>>> not 2d >>>>> * finally i came up which an algoithm which offsets the polygon with >>>>> negative values iteratively. >>>>> at some point two corners melt into one. this is exaclty the >>>>> required "helper point" to use to tesselate the polygon in a concave - >>>>> friendly way. >>>>> (actually i believe this algorithm is very similar to openscad >>>>> "roof" function. >>>>> >>>>> Hope you got an idea, how the algorithm works, but i doubt you will >>>>> make it in python... >>>>> >>>>> cheers >>>>> >>>>> >>>>> >>>>> On Fri, Feb 24, 2023 at 3:07 PM Sanjeev Prabhakar < >>>>> sprabhakar2006@gmail.com> wrote: >>>>> >>>>>> Hi Guenther >>>>>> >>>>>> Your picture of the split looks interesting. >>>>>> >>>>>> Can you give some more information on the workflow and the logic. >>>>>> >>>>>> In case it is possible to share the stltool developed by you, would >>>>>> be great, although i have very limited understanding of softwares. >>>>>> >>>>>> I started working on openscad as it initially looked simpler to work >>>>>> on. >>>>>> >>>>>> Then learnt a little bit of python to circumvent the limitations of >>>>>> openscad language. >>>>>> >>>>>> Now it seems I need to learn another one. Not sure if I will do that >>>>>> as it is taking a lot of my time. >>>>>> >>>>>> Anyway, I am not using it for any professional purposes and is a >>>>>> hobby. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Fri, 24 Feb, 2023, 7:15 pm Guenther Sohler, < >>>>>> guenther.sohler@gmail.com> wrote: >>>>>> >>>>>>> hi Sanjeev, >>>>>>> >>>>>>> I know exactly what you mean, I also do green-sand-casting and >>>>>>> demolding it *the* key for successful metal casting. >>>>>>> >>>>>>> I spent over 6 month on writing software to find the best split of a >>>>>>> given bust stl file programmatically. the tool is called "stltool" >>>>>>> >>>>>>> Right now developing the tool is on hold as I need some time for >>>>>>> more inspiration. >>>>>>> >>>>>>> Examples of successful splits are here: >>>>>>> >>>>>>> https://twitter.com/gadget_3d/status/1581385519308890112/photo/1 >>>>>>> >>>>>>> was also able to split "batman" mold successfully, but by far not >>>>>>> all bust are splittable for molding. >>>>>>> >>>>>>> when splitting your weel, which is very symmetrical, isn't it >>>>>>> possible to split the face at the symmetry line using "difference" or >>>>>>> "intersection" ? >>>>>>> >>>>>>> -------- >>>>>>> when you very easily split your triangles into two bins when >>>>>>> watching if the z coordinate of the normal vector is pointing up or down. >>>>>>> >>>>>>> For my tool i spent >>>>>>> >>>>>>> 25% of the time on finding the best cut line around the model >>>>>>> 75% of the time to filling the big hole in the model which arises >>>>>>> when splitting the model into 2 halves .... >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Fri, Feb 24, 2023 at 2:29 PM Sanjeev Prabhakar < >>>>>>> sprabhakar2006@gmail.com> wrote: >>>>>>> >>>>>>>> I have a requirement to develop a casting mould for a part e.g. >>>>>>>> wheel. >>>>>>>> >>>>>>>> All the surfaces which are visible from top needs to be extracted >>>>>>>> to get one half of the mould. >>>>>>>> >>>>>>>> Similarly surfaces which are visible from bottom needs to be >>>>>>>> extracted to develop other side of the mould. >>>>>>>> >>>>>>>> Parting lines can be zigzag depending on the part geometry. >>>>>>>> >>>>>>>> Any ideas to do such a thing in openscad will be really helpful >>>>>>>> >>>>>>>> Regards >>>>>>>> Sanjeev >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> OpenSCAD mailing list >>>>>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>>>>>> >>>>>>> _______________________________________________ >>>>>>> OpenSCAD mailing list >>>>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>>>>> >>>>>> _______________________________________________ >>>>>> OpenSCAD mailing list >>>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>>>> >>>>> _______________________________________________ >>>>> OpenSCAD mailing list >>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>>> >>>> _______________________________________________ >>>> OpenSCAD mailing list >>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >