discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Using offset() with delta > 0 on vertices that are close but not quite identical

GC
Gareth Chen
Fri, Jul 23, 2021 12:09 PM

I'm trying to use the non-radial mode of offset() on a 2D shape that I've
constructed using a union() of two hulls, where the two shapes meet at a
vertex. Due to how the geometry is constructed, these two vertices are not
placed in exactly the same location, but are located within 0.01 units of
each other. This causes issues with offset(), because the two vertices are
operated on separately, creating a jagged outline. The jaggedness of the
outline doesn't really change at all unless the points are moved within
about 0.00003 units of each other, at which point it seems like they're
treated as the same point. I've uploaded some pictures here for reference:
https://imgur.com/a/brSkMh1.

This is annoying because it's not really practical to always position the
shapes within that 0.00003-unit tolerance, as they're generated from a
vector of values that's intended to be configurable, so I wouldn't be able
to do the geometric calculations without developing a much more complex
generalized system.

Is there some kind of module that I can use to connect these two points or
otherwise hide the gap? I can't use hull() because the shape is convex in
other places. I also tried using offset(r=0.01) to smooth out the gap
before using the non-radial offset, but that had the side effect of
rounding out all the corners, and I need the ability to control the
rounding to values smaller than the offset.

Alternatively, is there a way to decrease the internal tolerance used to
determine if two points are in the same location?

Thanks for your help,
Gareth

I'm trying to use the non-radial mode of offset() on a 2D shape that I've constructed using a union() of two hulls, where the two shapes meet at a vertex. Due to how the geometry is constructed, these two vertices are not placed in exactly the same location, but are located within 0.01 units of each other. This causes issues with offset(), because the two vertices are operated on separately, creating a jagged outline. The jaggedness of the outline doesn't really change at all unless the points are moved within about 0.00003 units of each other, at which point it seems like they're treated as the same point. I've uploaded some pictures here for reference: https://imgur.com/a/brSkMh1. This is annoying because it's not really practical to always position the shapes within that 0.00003-unit tolerance, as they're generated from a vector of values that's intended to be configurable, so I wouldn't be able to do the geometric calculations without developing a much more complex generalized system. Is there some kind of module that I can use to connect these two points or otherwise hide the gap? I can't use hull() because the shape is convex in other places. I also tried using offset(r=0.01) to smooth out the gap before using the non-radial offset, but that had the side effect of rounding out all the corners, and I need the ability to control the rounding to values smaller than the offset. Alternatively, is there a way to decrease the internal tolerance used to determine if two points are in the same location? Thanks for your help, Gareth
MM
Michael Marx
Fri, Jul 23, 2021 12:55 PM

Don't operate at micron scale.

"two shapes meet at a vertex" is non-manifold.

Operate at a larger scale (x 1000), then de-scale (0.001) the final object.


From: Gareth Chen [mailto:garethenator@gmail.com]
Sent: Fri, 23 Jul 2021 22:10
To: OpenSCAD general discussion
Subject: [OpenSCAD] Using offset() with delta > 0 on vertices that are close but not quite identical

I'm trying to use the non-radial mode of offset() on a 2D shape that I've constructed using a union() of two hulls, where the two shapes meet at a vertex. Due to how the geometry is constructed, these two vertices are not placed in exactly the same location, but are located within 0.01 units of each other. This causes issues with offset(), because the two vertices are operated on separately, creating a jagged outline. The jaggedness of the outline doesn't really change at all unless the points are moved within about 0.00003 units of each other, at which point it seems like they're treated as the same point. I've uploaded some pictures here for reference: https://imgur.com/a/brSkMh1.

This is annoying because it's not really practical to always position the shapes within that 0.00003-unit tolerance, as they're generated from a vector of values that's intended to be configurable, so I wouldn't be able to do the geometric calculations without developing a much more complex generalized system.

Is there some kind of module that I can use to connect these two points or otherwise hide the gap? I can't use hull() because the shape is convex in other places. I also tried using offset(r=0.01) to smooth out the gap before using the non-radial offset, but that had the side effect of rounding out all the corners, and I need the ability to control the rounding to values smaller than the offset.

Alternatively, is there a way to decrease the internal tolerance used to determine if two points are in the same location?

Thanks for your help,

Gareth

--
This email has been checked for viruses by AVG.
https://www.avg.com

Don't operate at micron scale. "two shapes meet at a vertex" is non-manifold. Operate at a larger scale (x 1000), then de-scale (0.001) the final object. _____ From: Gareth Chen [mailto:garethenator@gmail.com] Sent: Fri, 23 Jul 2021 22:10 To: OpenSCAD general discussion Subject: [OpenSCAD] Using offset() with delta > 0 on vertices that are close but not quite identical I'm trying to use the non-radial mode of offset() on a 2D shape that I've constructed using a union() of two hulls, where the two shapes meet at a vertex. Due to how the geometry is constructed, these two vertices are not placed in exactly the same location, but are located within 0.01 units of each other. This causes issues with offset(), because the two vertices are operated on separately, creating a jagged outline. The jaggedness of the outline doesn't really change at all unless the points are moved within about 0.00003 units of each other, at which point it seems like they're treated as the same point. I've uploaded some pictures here for reference: https://imgur.com/a/brSkMh1. This is annoying because it's not really practical to always position the shapes within that 0.00003-unit tolerance, as they're generated from a vector of values that's intended to be configurable, so I wouldn't be able to do the geometric calculations without developing a much more complex generalized system. Is there some kind of module that I can use to connect these two points or otherwise hide the gap? I can't use hull() because the shape is convex in other places. I also tried using offset(r=0.01) to smooth out the gap before using the non-radial offset, but that had the side effect of rounding out all the corners, and I need the ability to control the rounding to values smaller than the offset. Alternatively, is there a way to decrease the internal tolerance used to determine if two points are in the same location? Thanks for your help, Gareth -- This email has been checked for viruses by AVG. https://www.avg.com
GC
Gareth Chen
Fri, Jul 23, 2021 7:00 PM

Don't operate at micron scale.

I'm not creating something that's at micron scale. The issue is that
positioning two objects accurately requires micron accuracy when there's
angles and trig involved.

"two shapes meet at a vertex" is non-manifold.

You can see this in the images I provided, but the two shapes are mostly
overlapping, and the vertex they meet at forms a convex exterior angle.

Operate at a larger scale (x 1000), then de-scale (0.001) the final

object.

This would make the problem worse, since it would still require
micron-level positioning accuracy, but now there's more digits of precision
I need to fill up. I guess I could do the opposite to force the points to
merge. That might work, though it also might mess up other dimensions that
are more critical. I'll give it a try.

I can't use hull() because the shape is convex in other places.

Replying to myself here to clarify that I mean concave, not convex.
On Fri, Jul 23, 2021, 5:56 AM Michael Marx michael@marx.id.au wrote:

Don't operate at micron scale.

"two shapes meet at a vertex" is non-manifold.

Operate at a larger scale (x 1000), then de-scale (0.001) the final
object.


From: Gareth Chen [mailto:garethenator@gmail.com]
Sent: Fri, 23 Jul 2021 22:10
To: OpenSCAD general discussion
Subject: [OpenSCAD] Using offset() with delta > 0 on vertices that are
close but not quite identical

I'm trying to use the non-radial mode of offset() on a 2D shape that I've
constructed using a union() of two hulls, where the two shapes meet at a
vertex. Due to how the geometry is constructed, these two vertices are not
placed in exactly the same location, but are located within 0.01 units of
each other. This causes issues with offset(), because the two vertices are
operated on separately, creating a jagged outline. The jaggedness of the
outline doesn't really change at all unless the points are moved within
about 0.00003 units of each other, at which point it seems like they're
treated as the same point. I've uploaded some pictures here for reference:
https://imgur.com/a/brSkMh1.

This is annoying because it's not really practical to always position the
shapes within that 0.00003-unit tolerance, as they're generated from a
vector of values that's intended to be configurable, so I wouldn't be able
to do the geometric calculations without developing a much more complex
generalized system.

Is there some kind of module that I can use to connect these two points or
otherwise hide the gap? I can't use hull() because the shape is convex in
other places. I also tried using offset(r=0.01) to smooth out the gap
before using the non-radial offset, but that had the side effect of
rounding out all the corners, and I need the ability to control the
rounding to values smaller than the offset.

Alternatively, is there a way to decrease the internal tolerance used to
determine if two points are in the same location?

Thanks for your help,

Gareth

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient Virus-free.
www.avg.com
http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient
<#m_-8203136356498002555_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>


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

> Don't operate at micron scale. I'm not creating something that's at micron scale. The issue is that positioning two objects accurately requires micron accuracy when there's angles and trig involved. > "two shapes meet at a vertex" is non-manifold. You can see this in the images I provided, but the two shapes are mostly overlapping, and the vertex they meet at forms a convex exterior angle. > Operate at a larger scale (x 1000), then de-scale (0.001) the final object. This would make the problem worse, since it would still require micron-level positioning accuracy, but now there's more digits of precision I need to fill up. I guess I could do the opposite to force the points to merge. That might work, though it also might mess up other dimensions that are more critical. I'll give it a try. > I can't use hull() because the shape is convex in other places. Replying to myself here to clarify that I mean concave, not convex. On Fri, Jul 23, 2021, 5:56 AM Michael Marx <michael@marx.id.au> wrote: > Don't operate at micron scale. > > "two shapes meet at a vertex" is non-manifold. > > Operate at a larger scale (x 1000), then de-scale (0.001) the final > object. > > > ------------------------------ > > *From:* Gareth Chen [mailto:garethenator@gmail.com] > *Sent:* Fri, 23 Jul 2021 22:10 > *To:* OpenSCAD general discussion > *Subject:* [OpenSCAD] Using offset() with delta > 0 on vertices that are > close but not quite identical > > > > I'm trying to use the non-radial mode of offset() on a 2D shape that I've > constructed using a union() of two hulls, where the two shapes meet at a > vertex. Due to how the geometry is constructed, these two vertices are not > placed in exactly the same location, but are located within 0.01 units of > each other. This causes issues with offset(), because the two vertices are > operated on separately, creating a jagged outline. The jaggedness of the > outline doesn't really change at all unless the points are moved within > about 0.00003 units of each other, at which point it seems like they're > treated as the same point. I've uploaded some pictures here for reference: > https://imgur.com/a/brSkMh1. > > > > This is annoying because it's not really practical to always position the > shapes within that 0.00003-unit tolerance, as they're generated from a > vector of values that's intended to be configurable, so I wouldn't be able > to do the geometric calculations without developing a much more complex > generalized system. > > > > Is there some kind of module that I can use to connect these two points or > otherwise hide the gap? I can't use hull() because the shape is convex in > other places. I also tried using offset(r=0.01) to smooth out the gap > before using the non-radial offset, but that had the side effect of > rounding out all the corners, and I need the ability to control the > rounding to values smaller than the offset. > > > > Alternatively, is there a way to decrease the internal tolerance used to > determine if two points are in the same location? > > > > Thanks for your help, > > Gareth > > > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> Virus-free. > www.avg.com > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> > <#m_-8203136356498002555_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
GC
Gareth Chen
Sat, Jul 24, 2021 2:30 AM

I was able to get something working by scaling down, applying the offset,
and then scaling back up: https://imgur.com/a/2Nus2Ml
I guess this is decent enough for my purposes, but I'm still curious if
folks have other possible solutions.

On Fri, Jul 23, 2021 at 12:00 PM Gareth Chen garethenator@gmail.com wrote:

Don't operate at micron scale.

I'm not creating something that's at micron scale. The issue is that
positioning two objects accurately requires micron accuracy when there's
angles and trig involved.

"two shapes meet at a vertex" is non-manifold.

You can see this in the images I provided, but the two shapes are mostly
overlapping, and the vertex they meet at forms a convex exterior angle.

Operate at a larger scale (x 1000), then de-scale (0.001) the final

object.

This would make the problem worse, since it would still require
micron-level positioning accuracy, but now there's more digits of precision
I need to fill up. I guess I could do the opposite to force the points to
merge. That might work, though it also might mess up other dimensions that
are more critical. I'll give it a try.

I can't use hull() because the shape is convex in other places.

Replying to myself here to clarify that I mean concave, not convex.
On Fri, Jul 23, 2021, 5:56 AM Michael Marx michael@marx.id.au wrote:

Don't operate at micron scale.

"two shapes meet at a vertex" is non-manifold.

Operate at a larger scale (x 1000), then de-scale (0.001) the final
object.


From: Gareth Chen [mailto:garethenator@gmail.com]
Sent: Fri, 23 Jul 2021 22:10
To: OpenSCAD general discussion
Subject: [OpenSCAD] Using offset() with delta > 0 on vertices that are
close but not quite identical

I'm trying to use the non-radial mode of offset() on a 2D shape that I've
constructed using a union() of two hulls, where the two shapes meet at a
vertex. Due to how the geometry is constructed, these two vertices are not
placed in exactly the same location, but are located within 0.01 units of
each other. This causes issues with offset(), because the two vertices are
operated on separately, creating a jagged outline. The jaggedness of the
outline doesn't really change at all unless the points are moved within
about 0.00003 units of each other, at which point it seems like they're
treated as the same point. I've uploaded some pictures here for reference:
https://imgur.com/a/brSkMh1.

This is annoying because it's not really practical to always position the
shapes within that 0.00003-unit tolerance, as they're generated from a
vector of values that's intended to be configurable, so I wouldn't be able
to do the geometric calculations without developing a much more complex
generalized system.

Is there some kind of module that I can use to connect these two points
or otherwise hide the gap? I can't use hull() because the shape is convex
in other places. I also tried using offset(r=0.01) to smooth out the gap
before using the non-radial offset, but that had the side effect of
rounding out all the corners, and I need the ability to control the
rounding to values smaller than the offset.

Alternatively, is there a way to decrease the internal tolerance used to
determine if two points are in the same location?

Thanks for your help,

Gareth

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient Virus-free.
www.avg.com
http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient
<#m_-2527427564111683820_m_-8203136356498002555_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>


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

I was able to get something working by scaling down, applying the offset, and then scaling back up: https://imgur.com/a/2Nus2Ml I guess this is decent enough for my purposes, but I'm still curious if folks have other possible solutions. On Fri, Jul 23, 2021 at 12:00 PM Gareth Chen <garethenator@gmail.com> wrote: > > Don't operate at micron scale. > > I'm not creating something that's at micron scale. The issue is that > positioning two objects accurately requires micron accuracy when there's > angles and trig involved. > > > "two shapes meet at a vertex" is non-manifold. > > You can see this in the images I provided, but the two shapes are mostly > overlapping, and the vertex they meet at forms a convex exterior angle. > > > Operate at a larger scale (x 1000), then de-scale (0.001) the final > object. > > This would make the problem worse, since it would still require > micron-level positioning accuracy, but now there's more digits of precision > I need to fill up. I guess I could do the opposite to force the points to > merge. That might work, though it also might mess up other dimensions that > are more critical. I'll give it a try. > > > I can't use hull() because the shape is convex in other places. > > Replying to myself here to clarify that I mean concave, not convex. > On Fri, Jul 23, 2021, 5:56 AM Michael Marx <michael@marx.id.au> wrote: > >> Don't operate at micron scale. >> >> "two shapes meet at a vertex" is non-manifold. >> >> Operate at a larger scale (x 1000), then de-scale (0.001) the final >> object. >> >> >> ------------------------------ >> >> *From:* Gareth Chen [mailto:garethenator@gmail.com] >> *Sent:* Fri, 23 Jul 2021 22:10 >> *To:* OpenSCAD general discussion >> *Subject:* [OpenSCAD] Using offset() with delta > 0 on vertices that are >> close but not quite identical >> >> >> >> I'm trying to use the non-radial mode of offset() on a 2D shape that I've >> constructed using a union() of two hulls, where the two shapes meet at a >> vertex. Due to how the geometry is constructed, these two vertices are not >> placed in exactly the same location, but are located within 0.01 units of >> each other. This causes issues with offset(), because the two vertices are >> operated on separately, creating a jagged outline. The jaggedness of the >> outline doesn't really change at all unless the points are moved within >> about 0.00003 units of each other, at which point it seems like they're >> treated as the same point. I've uploaded some pictures here for reference: >> https://imgur.com/a/brSkMh1. >> >> >> >> This is annoying because it's not really practical to always position the >> shapes within that 0.00003-unit tolerance, as they're generated from a >> vector of values that's intended to be configurable, so I wouldn't be able >> to do the geometric calculations without developing a much more complex >> generalized system. >> >> >> >> Is there some kind of module that I can use to connect these two points >> or otherwise hide the gap? I can't use hull() because the shape is convex >> in other places. I also tried using offset(r=0.01) to smooth out the gap >> before using the non-radial offset, but that had the side effect of >> rounding out all the corners, and I need the ability to control the >> rounding to values smaller than the offset. >> >> >> >> Alternatively, is there a way to decrease the internal tolerance used to >> determine if two points are in the same location? >> >> >> >> Thanks for your help, >> >> Gareth >> >> >> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> Virus-free. >> www.avg.com >> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> >> <#m_-2527427564111683820_m_-8203136356498002555_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> >
M
MichaelAtOz
Sat, Jul 24, 2021 3:39 AM

Care to share your code?

It is difficult to suggest something else without knowing what info you have at hand, to position things.

For example, if you know the point of one part, you could try intersecting a small area around it and hull that bit.

It also matters what compromises are OK, if you don't mind a small rounding you could add a skinny circle overlapping the two points.


From: Gareth Chen [mailto:garethenator@gmail.com]
Sent: Sat, 24 Jul 2021 12:30
To: OpenSCAD general discussion
Subject: [OpenSCAD] Re: Using offset() with delta > 0 on vertices that are close but not quite identical

I was able to get something working by scaling down, applying the offset, and then scaling back up: https://imgur.com/a/2Nus2Ml

I guess this is decent enough for my purposes, but I'm still curious if folks have other possible solutions.

On Fri, Jul 23, 2021 at 12:00 PM Gareth Chen garethenator@gmail.com wrote:

Don't operate at micron scale.

I'm not creating something that's at micron scale. The issue is that positioning two objects accurately requires micron accuracy when there's angles and trig involved.

"two shapes meet at a vertex" is non-manifold.

You can see this in the images I provided, but the two shapes are mostly overlapping, and the vertex they meet at forms a convex exterior angle.

Operate at a larger scale (x 1000), then de-scale (0.001) the final object.

This would make the problem worse, since it would still require micron-level positioning accuracy, but now there's more digits of precision I need to fill up. I guess I could do the opposite to force the points to merge. That might work, though it also might mess up other dimensions that are more critical. I'll give it a try.

I can't use hull() because the shape is convex in other places.

Replying to myself here to clarify that I mean concave, not convex.

On Fri, Jul 23, 2021, 5:56 AM Michael Marx michael@marx.id.au wrote:

Don't operate at micron scale.

"two shapes meet at a vertex" is non-manifold.

Operate at a larger scale (x 1000), then de-scale (0.001) the final object.


From: Gareth Chen [mailto:garethenator@gmail.com]
Sent: Fri, 23 Jul 2021 22:10
To: OpenSCAD general discussion
Subject: [OpenSCAD] Using offset() with delta > 0 on vertices that are close but not quite identical

I'm trying to use the non-radial mode of offset() on a 2D shape that I've constructed using a union() of two hulls, where the two shapes meet at a vertex. Due to how the geometry is constructed, these two vertices are not placed in exactly the same location, but are located within 0.01 units of each other. This causes issues with offset(), because the two vertices are operated on separately, creating a jagged outline. The jaggedness of the outline doesn't really change at all unless the points are moved within about 0.00003 units of each other, at which point it seems like they're treated as the same point. I've uploaded some pictures here for reference: https://imgur.com/a/brSkMh1.

This is annoying because it's not really practical to always position the shapes within that 0.00003-unit tolerance, as they're generated from a vector of values that's intended to be configurable, so I wouldn't be able to do the geometric calculations without developing a much more complex generalized system.

Is there some kind of module that I can use to connect these two points or otherwise hide the gap? I can't use hull() because the shape is convex in other places. I also tried using offset(r=0.01) to smooth out the gap before using the non-radial offset, but that had the side effect of rounding out all the corners, and I need the ability to control the rounding to values smaller than the offset.

Alternatively, is there a way to decrease the internal tolerance used to determine if two points are in the same location?

Thanks for your help,

Gareth

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient

Virus-free.  http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient www.avg.com


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

--
This email has been checked for viruses by AVG.
https://www.avg.com

Care to share your code? It is difficult to suggest something else without knowing what info you have at hand, to position things. For example, if you know the point of one part, you could try intersecting a small area around it and hull that bit. It also matters what compromises are OK, if you don't mind a small rounding you could add a skinny circle overlapping the two points. _____ From: Gareth Chen [mailto:garethenator@gmail.com] Sent: Sat, 24 Jul 2021 12:30 To: OpenSCAD general discussion Subject: [OpenSCAD] Re: Using offset() with delta > 0 on vertices that are close but not quite identical I was able to get something working by scaling down, applying the offset, and then scaling back up: https://imgur.com/a/2Nus2Ml I guess this is decent enough for my purposes, but I'm still curious if folks have other possible solutions. On Fri, Jul 23, 2021 at 12:00 PM Gareth Chen <garethenator@gmail.com> wrote: > Don't operate at micron scale. I'm not creating something that's at micron scale. The issue is that positioning two objects accurately requires micron accuracy when there's angles and trig involved. > "two shapes meet at a vertex" is non-manifold. You can see this in the images I provided, but the two shapes are mostly overlapping, and the vertex they meet at forms a convex exterior angle. > Operate at a larger scale (x 1000), then de-scale (0.001) the final object. This would make the problem worse, since it would still require micron-level positioning accuracy, but now there's more digits of precision I need to fill up. I guess I could do the opposite to force the points to merge. That might work, though it also might mess up other dimensions that are more critical. I'll give it a try. > I can't use hull() because the shape is convex in other places. Replying to myself here to clarify that I mean concave, not convex. On Fri, Jul 23, 2021, 5:56 AM Michael Marx <michael@marx.id.au> wrote: Don't operate at micron scale. "two shapes meet at a vertex" is non-manifold. Operate at a larger scale (x 1000), then de-scale (0.001) the final object. _____ From: Gareth Chen [mailto:garethenator@gmail.com] Sent: Fri, 23 Jul 2021 22:10 To: OpenSCAD general discussion Subject: [OpenSCAD] Using offset() with delta > 0 on vertices that are close but not quite identical I'm trying to use the non-radial mode of offset() on a 2D shape that I've constructed using a union() of two hulls, where the two shapes meet at a vertex. Due to how the geometry is constructed, these two vertices are not placed in exactly the same location, but are located within 0.01 units of each other. This causes issues with offset(), because the two vertices are operated on separately, creating a jagged outline. The jaggedness of the outline doesn't really change at all unless the points are moved within about 0.00003 units of each other, at which point it seems like they're treated as the same point. I've uploaded some pictures here for reference: https://imgur.com/a/brSkMh1. This is annoying because it's not really practical to always position the shapes within that 0.00003-unit tolerance, as they're generated from a vector of values that's intended to be configurable, so I wouldn't be able to do the geometric calculations without developing a much more complex generalized system. Is there some kind of module that I can use to connect these two points or otherwise hide the gap? I can't use hull() because the shape is convex in other places. I also tried using offset(r=0.01) to smooth out the gap before using the non-radial offset, but that had the side effect of rounding out all the corners, and I need the ability to control the rounding to values smaller than the offset. Alternatively, is there a way to decrease the internal tolerance used to determine if two points are in the same location? Thanks for your help, Gareth <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> Virus-free. <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> www.avg.com _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org -- This email has been checked for viruses by AVG. https://www.avg.com
GC
Gareth Chen
Sat, Jul 24, 2021 7:01 AM

So this is part of a project I'm working on to generate keyboard plates and
cases from arrays of layout data about the keys and other components, which
includes x-y position, rotation, size, and some extra data. These elements
are positioned via an operator module that takes a layout input and
positions its children according to that.

For regular keyboards this isn't too hard to get things to line up, as all
the keys sit on a grid and have known spacings, but for keyboards with
thumb keys that are separated out and at an angle it becomes hard to get
the corners to line up exactly. Here's an example of where that would
happen on:
[image: image.png]
In this image you can't see the overlap because it's just a union, and the
error is ~0.01mm. However, when you offset the same shape you get this:
[image: image.png]

Because the elements are positioned procedurally, I'm looking for a method
that can automatically fix issues like this while at least preserving the
sharpness of other corners so they can be rounded to a smaller radius than
the offset (hence using a rounded offset all around is not ideal). The idea
of putting small circles on specific corners is interesting, but those
would need to be manually placed, which is a bit annoying.

If you're interested at looking at the actual project code, here's the
relevant portion:
https://github.com/50an6xy06r6n/hotswap_pcb_generator/blob/solid_case/scad/plate.scad#L16-L64

On Fri, Jul 23, 2021 at 8:40 PM MichaelAtOz oz.at.michael@gmail.com wrote:

Care to share your code?

It is difficult to suggest something else without knowing what info you
have at hand, to position things.

For example, if you know the point of one part, you could try intersecting
a small area around it and hull that bit.

It also matters what compromises are OK, if you don't mind a small
rounding you could add a skinny circle overlapping the two points.


From: Gareth Chen [mailto:garethenator@gmail.com]
Sent: Sat, 24 Jul 2021 12:30
To: OpenSCAD general discussion
Subject: [OpenSCAD] Re: Using offset() with delta > 0 on vertices that
are close but not quite identical

I was able to get something working by scaling down, applying the offset,
and then scaling back up: https://imgur.com/a/2Nus2Ml

I guess this is decent enough for my purposes, but I'm still curious if
folks have other possible solutions.

On Fri, Jul 23, 2021 at 12:00 PM Gareth Chen garethenator@gmail.com
wrote:

Don't operate at micron scale.

I'm not creating something that's at micron scale. The issue is that
positioning two objects accurately requires micron accuracy when there's
angles and trig involved.

"two shapes meet at a vertex" is non-manifold.

You can see this in the images I provided, but the two shapes are mostly
overlapping, and the vertex they meet at forms a convex exterior angle.

Operate at a larger scale (x 1000), then de-scale (0.001) the final

object.

This would make the problem worse, since it would still require
micron-level positioning accuracy, but now there's more digits of precision
I need to fill up. I guess I could do the opposite to force the points to
merge. That might work, though it also might mess up other dimensions that
are more critical. I'll give it a try.

I can't use hull() because the shape is convex in other places.

Replying to myself here to clarify that I mean concave, not convex.

On Fri, Jul 23, 2021, 5:56 AM Michael Marx michael@marx.id.au wrote:

Don't operate at micron scale.

"two shapes meet at a vertex" is non-manifold.

Operate at a larger scale (x 1000), then de-scale (0.001) the final
object.


From: Gareth Chen [mailto:garethenator@gmail.com]
Sent: Fri, 23 Jul 2021 22:10
To: OpenSCAD general discussion
Subject: [OpenSCAD] Using offset() with delta > 0 on vertices that are
close but not quite identical

I'm trying to use the non-radial mode of offset() on a 2D shape that I've
constructed using a union() of two hulls, where the two shapes meet at a
vertex. Due to how the geometry is constructed, these two vertices are not
placed in exactly the same location, but are located within 0.01 units of
each other. This causes issues with offset(), because the two vertices are
operated on separately, creating a jagged outline. The jaggedness of the
outline doesn't really change at all unless the points are moved within
about 0.00003 units of each other, at which point it seems like they're
treated as the same point. I've uploaded some pictures here for reference:
https://imgur.com/a/brSkMh1.

This is annoying because it's not really practical to always position the
shapes within that 0.00003-unit tolerance, as they're generated from a
vector of values that's intended to be configurable, so I wouldn't be able
to do the geometric calculations without developing a much more complex
generalized system.

Is there some kind of module that I can use to connect these two points or
otherwise hide the gap? I can't use hull() because the shape is convex in
other places. I also tried using offset(r=0.01) to smooth out the gap
before using the non-radial offset, but that had the side effect of
rounding out all the corners, and I need the ability to control the
rounding to values smaller than the offset.

Alternatively, is there a way to decrease the internal tolerance used to
determine if two points are in the same location?

Thanks for your help,

Gareth

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient

Virus-free. www.avg.com
http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient

<#m_527187341433729621_m_-2527427564111683820_m_-8203136356498>


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

So this is part of a project I'm working on to generate keyboard plates and cases from arrays of layout data about the keys and other components, which includes x-y position, rotation, size, and some extra data. These elements are positioned via an operator module that takes a layout input and positions its children according to that. For regular keyboards this isn't too hard to get things to line up, as all the keys sit on a grid and have known spacings, but for keyboards with thumb keys that are separated out and at an angle it becomes hard to get the corners to line up exactly. Here's an example of where that would happen on: [image: image.png] In this image you can't see the overlap because it's just a union, and the error is ~0.01mm. However, when you offset the same shape you get this: [image: image.png] Because the elements are positioned procedurally, I'm looking for a method that can automatically fix issues like this while at least preserving the sharpness of other corners so they can be rounded to a smaller radius than the offset (hence using a rounded offset all around is not ideal). The idea of putting small circles on specific corners is interesting, but those would need to be manually placed, which is a bit annoying. If you're interested at looking at the actual project code, here's the relevant portion: https://github.com/50an6xy06r6n/hotswap_pcb_generator/blob/solid_case/scad/plate.scad#L16-L64 On Fri, Jul 23, 2021 at 8:40 PM MichaelAtOz <oz.at.michael@gmail.com> wrote: > Care to share your code? > > It is difficult to suggest something else without knowing what info you > have at hand, to position things. > > For example, if you know the point of one part, you could try intersecting > a small area around it and hull that bit. > > It also matters what compromises are OK, if you don't mind a small > rounding you could add a skinny circle overlapping the two points. > > > ------------------------------ > > *From:* Gareth Chen [mailto:garethenator@gmail.com] > *Sent:* Sat, 24 Jul 2021 12:30 > *To:* OpenSCAD general discussion > *Subject:* [OpenSCAD] Re: Using offset() with delta > 0 on vertices that > are close but not quite identical > > > > I was able to get something working by scaling down, applying the offset, > and then scaling back up: https://imgur.com/a/2Nus2Ml > > I guess this is decent enough for my purposes, but I'm still curious if > folks have other possible solutions. > > > > On Fri, Jul 23, 2021 at 12:00 PM Gareth Chen <garethenator@gmail.com> > wrote: > > > Don't operate at micron scale. > > I'm not creating something that's at micron scale. The issue is that > positioning two objects accurately requires micron accuracy when there's > angles and trig involved. > > > "two shapes meet at a vertex" is non-manifold. > > You can see this in the images I provided, but the two shapes are mostly > overlapping, and the vertex they meet at forms a convex exterior angle. > > > Operate at a larger scale (x 1000), then de-scale (0.001) the final > object. > > This would make the problem worse, since it would still require > micron-level positioning accuracy, but now there's more digits of precision > I need to fill up. I guess I could do the opposite to force the points to > merge. That might work, though it also might mess up other dimensions that > are more critical. I'll give it a try. > > > I can't use hull() because the shape is convex in other places. > > Replying to myself here to clarify that I mean concave, not convex. > > On Fri, Jul 23, 2021, 5:56 AM Michael Marx <michael@marx.id.au> wrote: > > Don't operate at micron scale. > > "two shapes meet at a vertex" is non-manifold. > > Operate at a larger scale (x 1000), then de-scale (0.001) the final > object. > > > ------------------------------ > > *From:* Gareth Chen [mailto:garethenator@gmail.com] > *Sent:* Fri, 23 Jul 2021 22:10 > *To:* OpenSCAD general discussion > *Subject:* [OpenSCAD] Using offset() with delta > 0 on vertices that are > close but not quite identical > > > > I'm trying to use the non-radial mode of offset() on a 2D shape that I've > constructed using a union() of two hulls, where the two shapes meet at a > vertex. Due to how the geometry is constructed, these two vertices are not > placed in exactly the same location, but are located within 0.01 units of > each other. This causes issues with offset(), because the two vertices are > operated on separately, creating a jagged outline. The jaggedness of the > outline doesn't really change at all unless the points are moved within > about 0.00003 units of each other, at which point it seems like they're > treated as the same point. I've uploaded some pictures here for reference: > https://imgur.com/a/brSkMh1. > > > > This is annoying because it's not really practical to always position the > shapes within that 0.00003-unit tolerance, as they're generated from a > vector of values that's intended to be configurable, so I wouldn't be able > to do the geometric calculations without developing a much more complex > generalized system. > > > > Is there some kind of module that I can use to connect these two points or > otherwise hide the gap? I can't use hull() because the shape is convex in > other places. I also tried using offset(r=0.01) to smooth out the gap > before using the non-radial offset, but that had the side effect of > rounding out all the corners, and I need the ability to control the > rounding to values smaller than the offset. > > > > Alternatively, is there a way to decrease the internal tolerance used to > determine if two points are in the same location? > > > > Thanks for your help, > > Gareth > > > > > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> > > Virus-free. www.avg.com > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> > > <#m_527187341433729621_m_-2527427564111683820_m_-8203136356498> > > _______________________________________________ > 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 >
M
MichaelAtOz
Sat, Jul 24, 2021 7:38 AM

So the desirable result is a vertex at the red dot, and the two triangle protrusions either side trimmed??

--
This email has been checked for viruses by AVG.
https://www.avg.com

So the desirable result is a vertex at the red dot, and the two triangle protrusions either side trimmed?? -- This email has been checked for viruses by AVG. https://www.avg.com
GC
Gareth Chen
Sat, Jul 24, 2021 7:40 AM

Yeah. If you look at the pictures from my previous messages you can see
what it looks like after I do the scaling thing.

On Sat, Jul 24, 2021, 12:38 AM MichaelAtOz oz.at.michael@gmail.com wrote:

So the desirable result is a vertex at the red dot, and the two triangle
protrusions either side trimmed??

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient Virus-free.
www.avg.com
http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient
<#m_-4846649982479747196_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>


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

Yeah. If you look at the pictures from my previous messages you can see what it looks like after I do the scaling thing. On Sat, Jul 24, 2021, 12:38 AM MichaelAtOz <oz.at.michael@gmail.com> wrote: > So the desirable result is a vertex at the red dot, and the two triangle > protrusions either side trimmed?? > > > > > > > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> Virus-free. > www.avg.com > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> > <#m_-4846649982479747196_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
LM
Leonard Martin Struttmann
Sat, Jul 24, 2021 2:33 PM

Lop off the two triangular ears by difference() with two cubes positioned
on the edges of the square sections?

On Sat, Jul 24, 2021 at 2:38 AM MichaelAtOz oz.at.michael@gmail.com wrote:

So the desirable result is a vertex at the red dot, and the two triangle
protrusions either side trimmed??

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient Virus-free.
www.avg.com
http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient
<#m_-920161598978493291_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>


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

Lop off the two triangular ears by difference() with two cubes positioned on the edges of the square sections? On Sat, Jul 24, 2021 at 2:38 AM MichaelAtOz <oz.at.michael@gmail.com> wrote: > So the desirable result is a vertex at the red dot, and the two triangle > protrusions either side trimmed?? > > > > > > > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> Virus-free. > www.avg.com > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> > <#m_-920161598978493291_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
GC
Gareth Chen
Sat, Jul 24, 2021 7:47 PM

Yeah that could work, but I was hoping to find a solution that doesn't
require putting more information into the layout to define the boundary.

On Sat, Jul 24, 2021, 7:52 AM Leonard Martin Struttmann <
lenstruttmann@gmail.com> wrote:

Lop off the two triangular ears by difference() with two cubes positioned
on the edges of the square sections?

On Sat, Jul 24, 2021 at 2:38 AM MichaelAtOz oz.at.michael@gmail.com
wrote:

So the desirable result is a vertex at the red dot, and the two triangle
protrusions either side trimmed??

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient Virus-free.
www.avg.com
http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient
<#m_1047874935620255209_m_-920161598978493291_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>


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

Yeah that could work, but I was hoping to find a solution that doesn't require putting more information into the layout to define the boundary. On Sat, Jul 24, 2021, 7:52 AM Leonard Martin Struttmann < lenstruttmann@gmail.com> wrote: > Lop off the two triangular ears by difference() with two cubes positioned > on the edges of the square sections? > > > On Sat, Jul 24, 2021 at 2:38 AM MichaelAtOz <oz.at.michael@gmail.com> > wrote: > >> So the desirable result is a vertex at the red dot, and the two triangle >> protrusions either side trimmed?? >> >> >> >> >> >> >> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> Virus-free. >> www.avg.com >> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> >> <#m_1047874935620255209_m_-920161598978493291_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >> _______________________________________________ >> 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 >