discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

seat

SP
Sanjeev Prabhakar
Wed, Jun 5, 2024 2:52 PM

I realised that the video was not very clear.
here is a better version:
https://youtu.be/Aguq6eegUsI

On Wed, 5 Jun 2024 at 07:36, Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

I have posted an example of my design approach in a youtube video
(designing a mobile stand).

https://youtu.be/qb4QSLyCpNI

On Mon, 3 Jun 2024 at 06:58, Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

I am not good at explaining things. When I start explaining with
diagrams, it takes too long and I don't have that much time.
You can read the code in my github file openscad1.py and I can answer
some specific questions.
There are some 18 types of arc functions defined.
Key idea in these functions is to define the arcs in 2d which are not
very tough to define in openscad language as well and thereafter the same
functions can be used in 3d arcs. What you need is a method to transform 3d
points to 2d and then back to 3d at its original location.
Also there is no complex mathematics involved here

On Sun, 2 Jun 2024 at 21:47, William F. Adams via Discuss <
discuss@lists.openscad.org> wrote:

On Sunday, June 2, 2024 at 07:26:06 AM EDT, Jon Bondy via Discuss <
discuss@lists.openscad.org> wrote:

The OpenSCAD file is incomprehensible, to the point of being useless.
You are writing in Python, not in OpenSCAD. You are just using OpenSCAD as
rendering engine.

Let's turn this around --- if there was an OpenSCAD module for
representing such a design what would the interface look like?

I've asked before about representing curved surfaces in a fashion which
was elegant and expressible, and which folks who do not have an
understanding of higher maths could not merely grasp, but also write/use
--- while a couple of techniques have been put forward, I wasn't able to
wrap my mind around them, and I will readily admit to this being my
deficient education.

I've actually just finished adding support for arcs in my current
project:

https://github.com/WillAdams/gcodepreview

[image: Inline image]

(though I need to improve it to have Z-axis movement/cutting as well,
and yes, for some reason the arc generated come in as 25.1mm x 25mm curves
which don't meet up so as to make a circle, and they generate an error when
importing the DXF into some programs...)

Once that is done, I eventually hope to start working on adding some
sort of support for curves in 3 dimensions, or representing a curved
surface --- what is a way to do this which is:

  • reasonably concise
  • expressive and powerful
  • suitable to be calculated out within OpenSCAD

My current plan is to just do curves of tool movement in 3 dimensions
--- an overhead view of a Bézier curve for X and Y coordinates, and a
representation of a side view as a curve which shows Y and Z coordinates
--- to make a curved surface it would be necessary to arrange a sufficient
number of toolpaths so as to represent that tool movement when cutting out
that surface and ultimately this would need to be captured as G-code for
making that cut.

At one point in time I had a number of links which I had researched:

-
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#Surface
- Thingiverse: Bezier Heart in OpenScad
<https://www.thingiverse.com/thing:8483>
   - https://www.thingiverse.com/thing:8931
-
http://climberg.de/page/openscad-implementation-of-bezier-curves-of-any-degrees/
 https://climberg.de/post/openscad_bezier_curves
- https://github.com/JustinSDK/dotSCAD [19]
<http://forum.openscad.org/larger-number-of-control-points-for-Bezier-td22435.html>
 https://openhome.cc/eGossip/OpenSCAD/BezierCurve.html
https://openhome.cc/eGossip/OpenSCAD/lib-bezier_surface.html
- http://forum.openscad.org/smooth-3-D-curves-tc7766.html
- https://github.com/RLuckom/bezier-scad
https://www.raphaelluckom.com/posts/bezier_curves.html
-
http://forum.openscad.org/Rectangle-with-one-curved-edge-td21097.html
- http://kitwallace.tumblr.com/post/76273401911/loxodrome-in-openscad
- http://www.thingiverse.com/thing:1208001 [20]
<http://forum.openscad.org/Spline-interpolation-nSpline-td15207.html>
- https://www.blockscad3d.com/community/projects/68284

and I would be glad of reading recommendations, or example code which is
carefully and thoroughly explained.

William

--
https://designinto3d.com/
Sphinx of black quartz, judge my vow.


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

I realised that the video was not very clear. here is a better version: https://youtu.be/Aguq6eegUsI On Wed, 5 Jun 2024 at 07:36, Sanjeev Prabhakar <sprabhakar2006@gmail.com> wrote: > I have posted an example of my design approach in a youtube video > (designing a mobile stand). > > > https://youtu.be/qb4QSLyCpNI > > On Mon, 3 Jun 2024 at 06:58, Sanjeev Prabhakar <sprabhakar2006@gmail.com> > wrote: > >> I am not good at explaining things. When I start explaining with >> diagrams, it takes too long and I don't have that much time. >> You can read the code in my github file openscad1.py and I can answer >> some specific questions. >> There are some 18 types of arc functions defined. >> Key idea in these functions is to define the arcs in 2d which are not >> very tough to define in openscad language as well and thereafter the same >> functions can be used in 3d arcs. What you need is a method to transform 3d >> points to 2d and then back to 3d at its original location. >> Also there is no complex mathematics involved here >> >> On Sun, 2 Jun 2024 at 21:47, William F. Adams via Discuss < >> discuss@lists.openscad.org> wrote: >> >>> On Sunday, June 2, 2024 at 07:26:06 AM EDT, Jon Bondy via Discuss < >>> discuss@lists.openscad.org> wrote: >>> >>> The OpenSCAD file is incomprehensible, to the point of being useless. >>> You are writing in Python, not in OpenSCAD. You are just using OpenSCAD as >>> rendering engine. >>> >>> Let's turn this around --- if there was an OpenSCAD module for >>> representing such a design what would the interface look like? >>> >>> I've asked before about representing curved surfaces in a fashion which >>> was elegant and expressible, and which folks who do not have an >>> understanding of higher maths could not merely grasp, but also write/use >>> --- while a couple of techniques have been put forward, I wasn't able to >>> wrap my mind around them, and I will readily admit to this being my >>> deficient education. >>> >>> I've actually just finished adding support for arcs in my current >>> project: >>> >>> https://github.com/WillAdams/gcodepreview >>> >>> [image: Inline image] >>> >>> >>> (though I need to improve it to have Z-axis movement/cutting as well, >>> and yes, for some reason the arc generated come in as 25.1mm x 25mm curves >>> which don't meet up so as to make a circle, and they generate an error when >>> importing the DXF into some programs...) >>> >>> Once that is done, I eventually hope to start working on adding some >>> sort of support for curves in 3 dimensions, or representing a curved >>> surface --- what is a way to do this which is: >>> >>> - reasonably concise >>> - expressive and powerful >>> - suitable to be calculated out within OpenSCAD >>> >>> My current plan is to just do curves of tool movement in 3 dimensions >>> --- an overhead view of a Bézier curve for X and Y coordinates, and a >>> representation of a side view as a curve which shows Y and Z coordinates >>> --- to make a curved surface it would be necessary to arrange a sufficient >>> number of toolpaths so as to represent that tool movement when cutting out >>> that surface and ultimately this would need to be captured as G-code for >>> making that cut. >>> >>> At one point in time I had a number of links which I had researched: >>> >>> >>> - >>> https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#Surface >>> - Thingiverse: Bezier Heart in OpenScad >>> <https://www.thingiverse.com/thing:8483> >>> - https://www.thingiverse.com/thing:8931 >>> - >>> http://climberg.de/page/openscad-implementation-of-bezier-curves-of-any-degrees/ >>> https://climberg.de/post/openscad_bezier_curves >>> - https://github.com/JustinSDK/dotSCAD [19] >>> <http://forum.openscad.org/larger-number-of-control-points-for-Bezier-td22435.html> >>> https://openhome.cc/eGossip/OpenSCAD/BezierCurve.html >>> https://openhome.cc/eGossip/OpenSCAD/lib-bezier_surface.html >>> - http://forum.openscad.org/smooth-3-D-curves-tc7766.html >>> - https://github.com/RLuckom/bezier-scad >>> https://www.raphaelluckom.com/posts/bezier_curves.html >>> - >>> http://forum.openscad.org/Rectangle-with-one-curved-edge-td21097.html >>> - http://kitwallace.tumblr.com/post/76273401911/loxodrome-in-openscad >>> - http://www.thingiverse.com/thing:1208001 [20] >>> <http://forum.openscad.org/Spline-interpolation-nSpline-td15207.html> >>> - https://www.blockscad3d.com/community/projects/68284 >>> >>> >>> >>> >>> and I would be glad of reading recommendations, or example code which is >>> carefully and thoroughly explained. >>> >>> William >>> >>> -- >>> https://designinto3d.com/ >>> Sphinx of black quartz, judge my vow. >>> >>> >>> >>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >>
WF
William F. Adams
Thu, Jun 6, 2024 10:28 PM

My thanks to everyone's input and thoughts.
After thinking about this a bit, I believe that the following attributes would be desirable/necessary:
 - concise --- a given Bézier curve should be represented by just its coordinates, so two on-curve points, two off-curve points, each with a pair of coordinates - For a given shape/region it will need to be possible to have a matching definition exactly match up with it so that one could piece together a larger more complex shape from smaller/simpler regions - similarly it will be necessary for it to be possible to sub-divide a defined region --- for example it should be possible if one had 4 adjacent regions, then the four quadrants at the intersection of the four regions could be used to construct a new region --- is it possible to derive a new Bézier curve from half of two other curves?
It seems to me that for the three planes:
 - XY - XZ - ZY
it should be possible to have three Bézier curves (left-most/right-most or front-back or top/bottom for two, and a mid-line for the third), so any given region should be definable by:
 3 * planes * 3 * Bézier curves * (2 on-curve points + 2 off-curve points) == 36 coordinate pairs
which is a marked contrast to representations such as:
https://github.com/DavidPhillipOster/Teapot

I'm going to make a note on all this and will come back to it when I get a chance, but of course, I'd be delighted if someone else took this up.
William
-- Sphinx of black quartz, judge my vow.https://designinto3d.com/

My thanks to everyone's input and thoughts. After thinking about this a bit, I believe that the following attributes would be desirable/necessary:  - concise --- a given Bézier curve should be represented by just its coordinates, so two on-curve points, two off-curve points, each with a pair of coordinates - For a given shape/region it will need to be possible to have a matching definition exactly match up with it so that one could piece together a larger more complex shape from smaller/simpler regions - similarly it will be necessary for it to be possible to sub-divide a defined region --- for example it should be possible if one had 4 adjacent regions, then the four quadrants at the intersection of the four regions could be used to construct a new region --- is it possible to derive a new Bézier curve from half of two other curves? It seems to me that for the three planes:  - XY - XZ - ZY it should be possible to have three Bézier curves (left-most/right-most or front-back or top/bottom for two, and a mid-line for the third), so any given region should be definable by:  3 * planes * 3 * Bézier curves * (2 on-curve points + 2 off-curve points) == 36 coordinate pairs which is a marked contrast to representations such as: https://github.com/DavidPhillipOster/Teapot I'm going to make a note on all this and will come back to it when I get a chance, but of course, I'd be delighted if someone else took this up. William -- Sphinx of black quartz, judge my vow.https://designinto3d.com/
AM
Adrian Mariano
Fri, Jun 7, 2024 12:04 AM

You are assuming that a bezier curve can be represented by its endpoints
and two control points, I think.  That means you are assuming cubic
beziers.  But if you want to establish G2 continuity then cubic beziers
probably do not suffice.  I had to use quartic ones for that purpose.  It
may be that ultimately beziers aren't powerful enough.  That xnurbs thing I
linked to earlier is using nurbs, after all, which are much more powerful
than beziers.

I'm not sure what you mean about "derive a bezier from half of two other
curves".  But maybe this also links to the question about
3-dimensionality.  A cubic bezier surface requires a 4x4 array of control
points, and you don't seem to include that situation in your framework.
I'm not sure how you imagine that the different planes give rise to full
three dimensionality.

It seems to me like you need some method to be able to construct a bezier
patch (3d surface section) and then construct a continuation that mates to
the first one.  But it's not clear how to manage this, especially when it
comes to closing corners, and how to ensure that everything meets up
consistently.

On Thu, Jun 6, 2024 at 6:28 PM William F. Adams via Discuss <
discuss@lists.openscad.org> wrote:

My thanks to everyone's input and thoughts.

After thinking about this a bit, I believe that the following attributes
would be desirable/necessary:

  • concise --- a given Bézier curve should be represented by just its
    coordinates, so two on-curve points, two off-curve points, each with a pair
    of coordinates
  • For a given shape/region it will need to be possible to have a matching
    definition exactly match up with it so that one could piece together a
    larger more complex shape from smaller/simpler regions
  • similarly it will be necessary for it to be possible to sub-divide a
    defined region --- for example it should be possible if one had 4 adjacent
    regions, then the four quadrants at the intersection of the four regions
    could be used to construct a new region --- is it possible to derive a new Bézier
    curve from half of two other curves?

It seems to me that for the three planes:

  • XY
  • XZ
  • ZY

it should be possible to have three Bézier curves (left-most/right-most
or front-back or top/bottom for two, and a mid-line for the third), so any
given region should be definable by:

3 * planes * 3 * Bézier curves * (2 on-curve points + 2 off-curve
points) == 36 coordinate pairs

which is a marked contrast to representations such as:

https://github.com/DavidPhillipOster/Teapot

I'm going to make a note on all this and will come back to it when I get a
chance, but of course, I'd be delighted if someone else took this up.

William

--
Sphinx of black quartz, judge my vow.
https://designinto3d.com/


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

You are assuming that a bezier curve can be represented by its endpoints and two control points, I think. That means you are assuming cubic beziers. But if you want to establish G2 continuity then cubic beziers probably do not suffice. I had to use quartic ones for that purpose. It may be that ultimately beziers aren't powerful enough. That xnurbs thing I linked to earlier is using nurbs, after all, which are much more powerful than beziers. I'm not sure what you mean about "derive a bezier from half of two other curves". But maybe this also links to the question about 3-dimensionality. A cubic bezier surface requires a 4x4 array of control points, and you don't seem to include that situation in your framework. I'm not sure how you imagine that the different planes give rise to full three dimensionality. It seems to me like you need some method to be able to construct a bezier patch (3d surface section) and then construct a continuation that mates to the first one. But it's not clear how to manage this, especially when it comes to closing corners, and how to ensure that everything meets up consistently. On Thu, Jun 6, 2024 at 6:28 PM William F. Adams via Discuss < discuss@lists.openscad.org> wrote: > My thanks to everyone's input and thoughts. > > After thinking about this a bit, I believe that the following attributes > would be desirable/necessary: > > - concise --- a given Bézier curve should be represented by just its > coordinates, so two on-curve points, two off-curve points, each with a pair > of coordinates > - For a given shape/region it will need to be possible to have a matching > definition exactly match up with it so that one could piece together a > larger more complex shape from smaller/simpler regions > - similarly it will be necessary for it to be possible to sub-divide a > defined region --- for example it should be possible if one had 4 adjacent > regions, then the four quadrants at the intersection of the four regions > could be used to construct a new region --- is it possible to derive a new Bézier > curve from half of two other curves? > > It seems to me that for the three planes: > > - XY > - XZ > - ZY > > it should be possible to have three Bézier curves (left-most/right-most > or front-back or top/bottom for two, and a mid-line for the third), so any > given region should be definable by: > > 3 * planes * 3 * Bézier curves * (2 on-curve points + 2 off-curve > points) == 36 coordinate pairs > > which is a marked contrast to representations such as: > > https://github.com/DavidPhillipOster/Teapot > > > I'm going to make a note on all this and will come back to it when I get a > chance, but of course, I'd be delighted if someone else took this up. > > William > > -- > Sphinx of black quartz, judge my vow. > https://designinto3d.com/ > > > > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
SP
Sanjeev Prabhakar
Fri, Jun 7, 2024 1:01 AM

For a closed section, it needs to be divided in to 2 halfs to apply bezier.
But then it should be done in such a way that each half is not starting
from a corner of the section and finally join them together after applying
bezier.

Obviously this is not an automatic application, user needs to identify the
right place to start and end the 2 halfs for better results.

There could be cases where this may not be possible.

I rarely use this though.

On Fri, 7 Jun, 2024, 5:34 am Adrian Mariano via Discuss, <
discuss@lists.openscad.org> wrote:

You are assuming that a bezier curve can be represented by its endpoints
and two control points, I think.  That means you are assuming cubic
beziers.  But if you want to establish G2 continuity then cubic beziers
probably do not suffice.  I had to use quartic ones for that purpose.  It
may be that ultimately beziers aren't powerful enough.  That xnurbs thing I
linked to earlier is using nurbs, after all, which are much more powerful
than beziers.

I'm not sure what you mean about "derive a bezier from half of two other
curves".  But maybe this also links to the question about
3-dimensionality.  A cubic bezier surface requires a 4x4 array of control
points, and you don't seem to include that situation in your framework.
I'm not sure how you imagine that the different planes give rise to full
three dimensionality.

It seems to me like you need some method to be able to construct a bezier
patch (3d surface section) and then construct a continuation that mates to
the first one.  But it's not clear how to manage this, especially when it
comes to closing corners, and how to ensure that everything meets up
consistently.

On Thu, Jun 6, 2024 at 6:28 PM William F. Adams via Discuss <
discuss@lists.openscad.org> wrote:

My thanks to everyone's input and thoughts.

After thinking about this a bit, I believe that the following attributes
would be desirable/necessary:

  • concise --- a given Bézier curve should be represented by just its
    coordinates, so two on-curve points, two off-curve points, each with a pair
    of coordinates
  • For a given shape/region it will need to be possible to have a
    matching definition exactly match up with it so that one could piece
    together a larger more complex shape from smaller/simpler regions
  • similarly it will be necessary for it to be possible to sub-divide a
    defined region --- for example it should be possible if one had 4 adjacent
    regions, then the four quadrants at the intersection of the four regions
    could be used to construct a new region --- is it possible to derive a new Bézier
    curve from half of two other curves?

It seems to me that for the three planes:

  • XY
  • XZ
  • ZY

it should be possible to have three Bézier curves (left-most/right-most
or front-back or top/bottom for two, and a mid-line for the third), so any
given region should be definable by:

3 * planes * 3 * Bézier curves * (2 on-curve points + 2 off-curve
points) == 36 coordinate pairs

which is a marked contrast to representations such as:

https://github.com/DavidPhillipOster/Teapot

I'm going to make a note on all this and will come back to it when I get
a chance, but of course, I'd be delighted if someone else took this up.

William

--
Sphinx of black quartz, judge my vow.
https://designinto3d.com/


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

For a closed section, it needs to be divided in to 2 halfs to apply bezier. But then it should be done in such a way that each half is not starting from a corner of the section and finally join them together after applying bezier. Obviously this is not an automatic application, user needs to identify the right place to start and end the 2 halfs for better results. There could be cases where this may not be possible. I rarely use this though. On Fri, 7 Jun, 2024, 5:34 am Adrian Mariano via Discuss, < discuss@lists.openscad.org> wrote: > You are assuming that a bezier curve can be represented by its endpoints > and two control points, I think. That means you are assuming cubic > beziers. But if you want to establish G2 continuity then cubic beziers > probably do not suffice. I had to use quartic ones for that purpose. It > may be that ultimately beziers aren't powerful enough. That xnurbs thing I > linked to earlier is using nurbs, after all, which are much more powerful > than beziers. > > I'm not sure what you mean about "derive a bezier from half of two other > curves". But maybe this also links to the question about > 3-dimensionality. A cubic bezier surface requires a 4x4 array of control > points, and you don't seem to include that situation in your framework. > I'm not sure how you imagine that the different planes give rise to full > three dimensionality. > > It seems to me like you need some method to be able to construct a bezier > patch (3d surface section) and then construct a continuation that mates to > the first one. But it's not clear how to manage this, especially when it > comes to closing corners, and how to ensure that everything meets up > consistently. > > On Thu, Jun 6, 2024 at 6:28 PM William F. Adams via Discuss < > discuss@lists.openscad.org> wrote: > >> My thanks to everyone's input and thoughts. >> >> After thinking about this a bit, I believe that the following attributes >> would be desirable/necessary: >> >> - concise --- a given Bézier curve should be represented by just its >> coordinates, so two on-curve points, two off-curve points, each with a pair >> of coordinates >> - For a given shape/region it will need to be possible to have a >> matching definition exactly match up with it so that one could piece >> together a larger more complex shape from smaller/simpler regions >> - similarly it will be necessary for it to be possible to sub-divide a >> defined region --- for example it should be possible if one had 4 adjacent >> regions, then the four quadrants at the intersection of the four regions >> could be used to construct a new region --- is it possible to derive a new Bézier >> curve from half of two other curves? >> >> It seems to me that for the three planes: >> >> - XY >> - XZ >> - ZY >> >> it should be possible to have three Bézier curves (left-most/right-most >> or front-back or top/bottom for two, and a mid-line for the third), so any >> given region should be definable by: >> >> 3 * planes * 3 * Bézier curves * (2 on-curve points + 2 off-curve >> points) == 36 coordinate pairs >> >> which is a marked contrast to representations such as: >> >> https://github.com/DavidPhillipOster/Teapot >> >> >> I'm going to make a note on all this and will come back to it when I get >> a chance, but of course, I'd be delighted if someone else took this up. >> >> William >> >> -- >> Sphinx of black quartz, judge my vow. >> https://designinto3d.com/ >> >> >> >> >> >> _______________________________________________ >> 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, Jun 7, 2024 1:07 AM

Bezier has a well defined formula, whichbworks for both 2d and 3d equally

You can refer this wiki
https://en.m.wikipedia.org/wiki/B%C3%A9zier_curve

Go to the degree elevation section

But if you need a specific radius curve or fillet, I don't think bezier
will work.

On Fri, 7 Jun, 2024, 3:58 am William F. Adams via Discuss, <
discuss@lists.openscad.org> wrote:

My thanks to everyone's input and thoughts.

After thinking about this a bit, I believe that the following attributes
would be desirable/necessary:

  • concise --- a given Bézier curve should be represented by just its
    coordinates, so two on-curve points, two off-curve points, each with a pair
    of coordinates
  • For a given shape/region it will need to be possible to have a matching
    definition exactly match up with it so that one could piece together a
    larger more complex shape from smaller/simpler regions
  • similarly it will be necessary for it to be possible to sub-divide a
    defined region --- for example it should be possible if one had 4 adjacent
    regions, then the four quadrants at the intersection of the four regions
    could be used to construct a new region --- is it possible to derive a new Bézier
    curve from half of two other curves?

It seems to me that for the three planes:

  • XY
  • XZ
  • ZY

it should be possible to have three Bézier curves (left-most/right-most
or front-back or top/bottom for two, and a mid-line for the third), so any
given region should be definable by:

3 * planes * 3 * Bézier curves * (2 on-curve points + 2 off-curve
points) == 36 coordinate pairs

which is a marked contrast to representations such as:

https://github.com/DavidPhillipOster/Teapot

I'm going to make a note on all this and will come back to it when I get a
chance, but of course, I'd be delighted if someone else took this up.

William

--
Sphinx of black quartz, judge my vow.
https://designinto3d.com/


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

Bezier has a well defined formula, whichbworks for both 2d and 3d equally You can refer this wiki https://en.m.wikipedia.org/wiki/B%C3%A9zier_curve Go to the degree elevation section But if you need a specific radius curve or fillet, I don't think bezier will work. On Fri, 7 Jun, 2024, 3:58 am William F. Adams via Discuss, < discuss@lists.openscad.org> wrote: > My thanks to everyone's input and thoughts. > > After thinking about this a bit, I believe that the following attributes > would be desirable/necessary: > > - concise --- a given Bézier curve should be represented by just its > coordinates, so two on-curve points, two off-curve points, each with a pair > of coordinates > - For a given shape/region it will need to be possible to have a matching > definition exactly match up with it so that one could piece together a > larger more complex shape from smaller/simpler regions > - similarly it will be necessary for it to be possible to sub-divide a > defined region --- for example it should be possible if one had 4 adjacent > regions, then the four quadrants at the intersection of the four regions > could be used to construct a new region --- is it possible to derive a new Bézier > curve from half of two other curves? > > It seems to me that for the three planes: > > - XY > - XZ > - ZY > > it should be possible to have three Bézier curves (left-most/right-most > or front-back or top/bottom for two, and a mid-line for the third), so any > given region should be definable by: > > 3 * planes * 3 * Bézier curves * (2 on-curve points + 2 off-curve > points) == 36 coordinate pairs > > which is a marked contrast to representations such as: > > https://github.com/DavidPhillipOster/Teapot > > > I'm going to make a note on all this and will come back to it when I get a > chance, but of course, I'd be delighted if someone else took this up. > > William > > -- > Sphinx of black quartz, judge my vow. > https://designinto3d.com/ > > > > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
WF
William F. Adams
Fri, Jun 7, 2024 1:14 AM

My idea is that the Bézier curves would be used to define toolpaths which would then cut out regions --- I'm not concerned about being able to represent all possible shapes or converting from one shape to another --- simply being able to either write out G-code describing the toolpaths or get an STL should suffice for my needs.

If a given shape could not be achieved, then one would sub-divide it and presumably be able to create the shape as desired using the smaller region.

As noted before, I'd be glad of someone else doing a better implementation --- it's not something I'm likely to get to in the near future.

William

-- 
Sphinx of black quartz, judge my vow
https://designinto3d.com/

My idea is that the Bézier curves would be used to define toolpaths which would then cut out regions --- I'm not concerned about being able to represent all possible shapes or converting from one shape to another --- simply being able to either write out G-code describing the toolpaths or get an STL should suffice for my needs. If a given shape could not be achieved, then one would sub-divide it and presumably be able to create the shape as desired using the smaller region. As noted before, I'd be glad of someone else doing a better implementation --- it's not something I'm likely to get to in the near future. William --  Sphinx of black quartz, judge my vow https://designinto3d.com/
SP
Sanjeev Prabhakar
Fri, Jun 7, 2024 1:33 AM

I have written following function to convert an list of points to to a
bezier curve.
Point list can be 2d or 3d

def bezier(p,s=10):
'''
bezier curve defined by points 'p' and number of segments 's'
'''
return array([array([
comb((len(p)-1),i)(1-t)((len(p)-1)-i)*tiarray(p[i]) for i in
range(len(p))]).sum(0) for t in linspace(0,1,s)]).tolist()

Another function required:

def comb(n,i):
'''
calculates number of possible combinations for "n" items with "i"
selected items
comb(8,2) => 28
'''
return int(math.factorial(n)/(math.factorial(i)*math.factorial(n-i)))

In this factorial is a function, I have taken from another library, but it
is much simpler to define.

You can try this if it makes sense

On Fri, 7 Jun, 2024, 6:44 am William F. Adams via Discuss, <
discuss@lists.openscad.org> wrote:

My idea is that the Bézier curves would be used to define toolpaths which
would then cut out regions --- I'm not concerned about being able to
represent all possible shapes or converting from one shape to another ---
simply being able to either write out G-code describing the toolpaths or
get an STL should suffice for my needs.

If a given shape could not be achieved, then one would sub-divide it and
presumably be able to create the shape as desired using the smaller region.

As noted before, I'd be glad of someone else doing a better implementation
--- it's not something I'm likely to get to in the near future.

William

--
Sphinx of black quartz, judge my vow
https://designinto3d.com/


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

I have written following function to convert an list of points to to a bezier curve. Point list can be 2d or 3d def bezier(p,s=10): ''' bezier curve defined by points 'p' and number of segments 's' ''' return array([array([ comb((len(p)-1),i)*(1-t)**((len(p)-1)-i)*t**i*array(p[i]) for i in range(len(p))]).sum(0) for t in linspace(0,1,s)]).tolist() Another function required: def comb(n,i): ''' calculates number of possible combinations for "n" items with "i" selected items comb(8,2) => 28 ''' return int(math.factorial(n)/(math.factorial(i)*math.factorial(n-i))) In this factorial is a function, I have taken from another library, but it is much simpler to define. You can try this if it makes sense On Fri, 7 Jun, 2024, 6:44 am William F. Adams via Discuss, < discuss@lists.openscad.org> wrote: > My idea is that the Bézier curves would be used to define toolpaths which > would then cut out regions --- I'm not concerned about being able to > represent all possible shapes or converting from one shape to another --- > simply being able to either write out G-code describing the toolpaths or > get an STL should suffice for my needs. > > If a given shape could not be achieved, then one would sub-divide it and > presumably be able to create the shape as desired using the smaller region. > > As noted before, I'd be glad of someone else doing a better implementation > --- it's not something I'm likely to get to in the near future. > > William > > -- > Sphinx of black quartz, judge my vow > https://designinto3d.com/ > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
AM
Adrian Mariano
Fri, Jun 7, 2024 2:25 AM

A bezier curve cannot produce a circle, so if you need a circular arc you
can't get it with a bezier.  You can approximate circles.  I never tried to
figure out a way to define an approximate radius when doing roundings with
beziers, because it seemed to me that in most cases, using other ways of
measuring the fillet are more intuitive anyway, and directly translatable
to beziers.

I'm not sure what degree elevation has to do with this conversation.  The
need for higher degree would be driven by a need to meet additional
constraints, like G2 continuity, and that requires building a bezier that
is naturally defined at the higher degree, not elevating to a higher
degree.  It conflicts with the stated requirement that beziers are
represented by only 4 points.

Note that BOSL2 has a highly optimized implementation of beziers within
OpenSCAD.

If you don't want to represent "all possible shapes" then what do you want
to represent?  How is your problem constrained or limited?  I'm interested
in being able to represent a broad range of shapes.  (All possible shapes
may be asking a lot.)  But the idea would be that you aren't constrained
when trying to design a shape where you hit a brick wall because the
implementation just can't do anything close to what you want.  Your
reference to tool paths makes me wonder if you're thinking in some more
constrained problem domain.

Generally when people use cubic beziers they use a sequence of them, not
just one.  This may be what you're thinking of with reference to
"subdividing".  But if you're doing this for surfaces rather than curves,
it seems like there are complicated issues with joining everything together
to create a valid surface without holes.  Note that B-splines may be
easier to use because you can more easily force them to go through desired
points or control the degree of smoothness.  A B-spline implementation is
something I've been planning to look into.  But it doesn't address the
higher level question of how to put it all together to make surfaces.

On Thu, Jun 6, 2024 at 9:08 PM Sanjeev Prabhakar via Discuss <
discuss@lists.openscad.org> wrote:

Bezier has a well defined formula, whichbworks for both 2d and 3d equally

You can refer this wiki
https://en.m.wikipedia.org/wiki/B%C3%A9zier_curve

Go to the degree elevation section

But if you need a specific radius curve or fillet, I don't think bezier
will work.

On Fri, 7 Jun, 2024, 3:58 am William F. Adams via Discuss, <
discuss@lists.openscad.org> wrote:

My thanks to everyone's input and thoughts.

After thinking about this a bit, I believe that the following attributes
would be desirable/necessary:

  • concise --- a given Bézier curve should be represented by just its
    coordinates, so two on-curve points, two off-curve points, each with a pair
    of coordinates
  • For a given shape/region it will need to be possible to have a
    matching definition exactly match up with it so that one could piece
    together a larger more complex shape from smaller/simpler regions
  • similarly it will be necessary for it to be possible to sub-divide a
    defined region --- for example it should be possible if one had 4 adjacent
    regions, then the four quadrants at the intersection of the four regions
    could be used to construct a new region --- is it possible to derive a new Bézier
    curve from half of two other curves?

It seems to me that for the three planes:

  • XY
  • XZ
  • ZY

it should be possible to have three Bézier curves (left-most/right-most
or front-back or top/bottom for two, and a mid-line for the third), so any
given region should be definable by:

3 * planes * 3 * Bézier curves * (2 on-curve points + 2 off-curve
points) == 36 coordinate pairs

which is a marked contrast to representations such as:

https://github.com/DavidPhillipOster/Teapot

I'm going to make a note on all this and will come back to it when I get
a chance, but of course, I'd be delighted if someone else took this up.

William

--
Sphinx of black quartz, judge my vow.
https://designinto3d.com/


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

A bezier curve cannot produce a circle, so if you need a circular arc you can't get it with a bezier. You can approximate circles. I never tried to figure out a way to define an approximate radius when doing roundings with beziers, because it seemed to me that in most cases, using other ways of measuring the fillet are more intuitive anyway, and directly translatable to beziers. I'm not sure what degree elevation has to do with this conversation. The need for higher degree would be driven by a need to meet additional constraints, like G2 continuity, and that requires building a bezier that is naturally defined at the higher degree, not elevating to a higher degree. It conflicts with the stated requirement that beziers are represented by only 4 points. Note that BOSL2 has a highly optimized implementation of beziers within OpenSCAD. If you don't want to represent "all possible shapes" then what do you want to represent? How is your problem constrained or limited? I'm interested in being able to represent a broad range of shapes. (All possible shapes may be asking a lot.) But the idea would be that you aren't constrained when trying to design a shape where you hit a brick wall because the implementation just can't do anything close to what you want. Your reference to tool paths makes me wonder if you're thinking in some more constrained problem domain. Generally when people use cubic beziers they use a sequence of them, not just one. This may be what you're thinking of with reference to "subdividing". But if you're doing this for surfaces rather than curves, it seems like there are complicated issues with joining everything together to create a valid surface without holes. Note that B-splines may be easier to use because you can more easily force them to go through desired points or control the degree of smoothness. A B-spline implementation is something I've been planning to look into. But it doesn't address the higher level question of how to put it all together to make surfaces. On Thu, Jun 6, 2024 at 9:08 PM Sanjeev Prabhakar via Discuss < discuss@lists.openscad.org> wrote: > Bezier has a well defined formula, whichbworks for both 2d and 3d equally > > You can refer this wiki > https://en.m.wikipedia.org/wiki/B%C3%A9zier_curve > > Go to the degree elevation section > > But if you need a specific radius curve or fillet, I don't think bezier > will work. > > On Fri, 7 Jun, 2024, 3:58 am William F. Adams via Discuss, < > discuss@lists.openscad.org> wrote: > >> My thanks to everyone's input and thoughts. >> >> After thinking about this a bit, I believe that the following attributes >> would be desirable/necessary: >> >> - concise --- a given Bézier curve should be represented by just its >> coordinates, so two on-curve points, two off-curve points, each with a pair >> of coordinates >> - For a given shape/region it will need to be possible to have a >> matching definition exactly match up with it so that one could piece >> together a larger more complex shape from smaller/simpler regions >> - similarly it will be necessary for it to be possible to sub-divide a >> defined region --- for example it should be possible if one had 4 adjacent >> regions, then the four quadrants at the intersection of the four regions >> could be used to construct a new region --- is it possible to derive a new Bézier >> curve from half of two other curves? >> >> It seems to me that for the three planes: >> >> - XY >> - XZ >> - ZY >> >> it should be possible to have three Bézier curves (left-most/right-most >> or front-back or top/bottom for two, and a mid-line for the third), so any >> given region should be definable by: >> >> 3 * planes * 3 * Bézier curves * (2 on-curve points + 2 off-curve >> points) == 36 coordinate pairs >> >> which is a marked contrast to representations such as: >> >> https://github.com/DavidPhillipOster/Teapot >> >> >> I'm going to make a note on all this and will come back to it when I get >> a chance, but of course, I'd be delighted if someone else took this up. >> >> William >> >> -- >> Sphinx of black quartz, judge my vow. >> https://designinto3d.com/ >> >> >> >> >> >> _______________________________________________ >> 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, Jun 7, 2024 3:18 AM

I think this needs a little more explanation, but mainly "degree of
elevation" means how many control points you have in the main curve. With
more control points the bezier curve will be near to the original curve and
that I think is very important in many cases.

I will explain this with some diagrams, maybe today evening once I am back
from the office.

Thanks

On Fri, 7 Jun 2024 at 07:56, Adrian Mariano via Discuss <
discuss@lists.openscad.org> wrote:

A bezier curve cannot produce a circle, so if you need a circular arc you
can't get it with a bezier.  You can approximate circles.  I never tried to
figure out a way to define an approximate radius when doing roundings with
beziers, because it seemed to me that in most cases, using other ways of
measuring the fillet are more intuitive anyway, and directly translatable
to beziers.

I'm not sure what degree elevation has to do with this conversation.  The
need for higher degree would be driven by a need to meet additional
constraints, like G2 continuity, and that requires building a bezier that
is naturally defined at the higher degree, not elevating to a higher
degree.  It conflicts with the stated requirement that beziers are
represented by only 4 points.

Note that BOSL2 has a highly optimized implementation of beziers within
OpenSCAD.

If you don't want to represent "all possible shapes" then what do you want
to represent?  How is your problem constrained or limited?  I'm interested
in being able to represent a broad range of shapes.  (All possible shapes
may be asking a lot.)  But the idea would be that you aren't constrained
when trying to design a shape where you hit a brick wall because the
implementation just can't do anything close to what you want.  Your
reference to tool paths makes me wonder if you're thinking in some more
constrained problem domain.

Generally when people use cubic beziers they use a sequence of them, not
just one.  This may be what you're thinking of with reference to
"subdividing".  But if you're doing this for surfaces rather than curves,
it seems like there are complicated issues with joining everything together
to create a valid surface without holes.  Note that B-splines may be
easier to use because you can more easily force them to go through desired
points or control the degree of smoothness.  A B-spline implementation is
something I've been planning to look into.  But it doesn't address the
higher level question of how to put it all together to make surfaces.

On Thu, Jun 6, 2024 at 9:08 PM Sanjeev Prabhakar via Discuss <
discuss@lists.openscad.org> wrote:

Bezier has a well defined formula, whichbworks for both 2d and 3d equally

You can refer this wiki
https://en.m.wikipedia.org/wiki/B%C3%A9zier_curve

Go to the degree elevation section

But if you need a specific radius curve or fillet, I don't think bezier
will work.

On Fri, 7 Jun, 2024, 3:58 am William F. Adams via Discuss, <
discuss@lists.openscad.org> wrote:

My thanks to everyone's input and thoughts.

After thinking about this a bit, I believe that the following attributes
would be desirable/necessary:

  • concise --- a given Bézier curve should be represented by just its
    coordinates, so two on-curve points, two off-curve points, each with a pair
    of coordinates
  • For a given shape/region it will need to be possible to have a
    matching definition exactly match up with it so that one could piece
    together a larger more complex shape from smaller/simpler regions
  • similarly it will be necessary for it to be possible to sub-divide a
    defined region --- for example it should be possible if one had 4 adjacent
    regions, then the four quadrants at the intersection of the four regions
    could be used to construct a new region --- is it possible to derive a new Bézier
    curve from half of two other curves?

It seems to me that for the three planes:

  • XY
  • XZ
  • ZY

it should be possible to have three Bézier curves (left-most/right-most
or front-back or top/bottom for two, and a mid-line for the third), so any
given region should be definable by:

3 * planes * 3 * Bézier curves * (2 on-curve points + 2 off-curve
points) == 36 coordinate pairs

which is a marked contrast to representations such as:

https://github.com/DavidPhillipOster/Teapot

I'm going to make a note on all this and will come back to it when I get
a chance, but of course, I'd be delighted if someone else took this up.

William

--
Sphinx of black quartz, judge my vow.
https://designinto3d.com/


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 think this needs a little more explanation, but mainly "degree of elevation" means how many control points you have in the main curve. With more control points the bezier curve will be near to the original curve and that I think is very important in many cases. I will explain this with some diagrams, maybe today evening once I am back from the office. Thanks On Fri, 7 Jun 2024 at 07:56, Adrian Mariano via Discuss < discuss@lists.openscad.org> wrote: > A bezier curve cannot produce a circle, so if you need a circular arc you > can't get it with a bezier. You can approximate circles. I never tried to > figure out a way to define an approximate radius when doing roundings with > beziers, because it seemed to me that in most cases, using other ways of > measuring the fillet are more intuitive anyway, and directly translatable > to beziers. > > I'm not sure what degree elevation has to do with this conversation. The > need for higher degree would be driven by a need to meet additional > constraints, like G2 continuity, and that requires building a bezier that > is naturally defined at the higher degree, not elevating to a higher > degree. It conflicts with the stated requirement that beziers are > represented by only 4 points. > > Note that BOSL2 has a highly optimized implementation of beziers within > OpenSCAD. > > If you don't want to represent "all possible shapes" then what do you want > to represent? How is your problem constrained or limited? I'm interested > in being able to represent a broad range of shapes. (All possible shapes > may be asking a lot.) But the idea would be that you aren't constrained > when trying to design a shape where you hit a brick wall because the > implementation just can't do anything close to what you want. Your > reference to tool paths makes me wonder if you're thinking in some more > constrained problem domain. > > Generally when people use cubic beziers they use a sequence of them, not > just one. This may be what you're thinking of with reference to > "subdividing". But if you're doing this for surfaces rather than curves, > it seems like there are complicated issues with joining everything together > to create a valid surface without holes. Note that B-splines may be > easier to use because you can more easily force them to go through desired > points or control the degree of smoothness. A B-spline implementation is > something I've been planning to look into. But it doesn't address the > higher level question of how to put it all together to make surfaces. > > On Thu, Jun 6, 2024 at 9:08 PM Sanjeev Prabhakar via Discuss < > discuss@lists.openscad.org> wrote: > >> Bezier has a well defined formula, whichbworks for both 2d and 3d equally >> >> You can refer this wiki >> https://en.m.wikipedia.org/wiki/B%C3%A9zier_curve >> >> Go to the degree elevation section >> >> But if you need a specific radius curve or fillet, I don't think bezier >> will work. >> >> On Fri, 7 Jun, 2024, 3:58 am William F. Adams via Discuss, < >> discuss@lists.openscad.org> wrote: >> >>> My thanks to everyone's input and thoughts. >>> >>> After thinking about this a bit, I believe that the following attributes >>> would be desirable/necessary: >>> >>> - concise --- a given Bézier curve should be represented by just its >>> coordinates, so two on-curve points, two off-curve points, each with a pair >>> of coordinates >>> - For a given shape/region it will need to be possible to have a >>> matching definition exactly match up with it so that one could piece >>> together a larger more complex shape from smaller/simpler regions >>> - similarly it will be necessary for it to be possible to sub-divide a >>> defined region --- for example it should be possible if one had 4 adjacent >>> regions, then the four quadrants at the intersection of the four regions >>> could be used to construct a new region --- is it possible to derive a new Bézier >>> curve from half of two other curves? >>> >>> It seems to me that for the three planes: >>> >>> - XY >>> - XZ >>> - ZY >>> >>> it should be possible to have three Bézier curves (left-most/right-most >>> or front-back or top/bottom for two, and a mid-line for the third), so any >>> given region should be definable by: >>> >>> 3 * planes * 3 * Bézier curves * (2 on-curve points + 2 off-curve >>> points) == 36 coordinate pairs >>> >>> which is a marked contrast to representations such as: >>> >>> https://github.com/DavidPhillipOster/Teapot >>> >>> >>> I'm going to make a note on all this and will come back to it when I get >>> a chance, but of course, I'd be delighted if someone else took this up. >>> >>> William >>> >>> -- >>> Sphinx of black quartz, judge my vow. >>> https://designinto3d.com/ >>> >>> >>> >>> >>> >>> _______________________________________________ >>> 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, Jun 7, 2024 2:51 PM

I have made a small video of impact of control points on the bezier

https://youtu.be/lPnyrEYest0

On Fri, 7 Jun 2024 at 08:48, Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

I think this needs a little more explanation, but mainly "degree of
elevation" means how many control points you have in the main curve. With
more control points the bezier curve will be near to the original curve and
that I think is very important in many cases.

I will explain this with some diagrams, maybe today evening once I am back
from the office.

Thanks

On Fri, 7 Jun 2024 at 07:56, Adrian Mariano via Discuss <
discuss@lists.openscad.org> wrote:

A bezier curve cannot produce a circle, so if you need a circular arc you
can't get it with a bezier.  You can approximate circles.  I never tried to
figure out a way to define an approximate radius when doing roundings with
beziers, because it seemed to me that in most cases, using other ways of
measuring the fillet are more intuitive anyway, and directly translatable
to beziers.

I'm not sure what degree elevation has to do with this conversation.  The
need for higher degree would be driven by a need to meet additional
constraints, like G2 continuity, and that requires building a bezier that
is naturally defined at the higher degree, not elevating to a higher
degree.  It conflicts with the stated requirement that beziers are
represented by only 4 points.

Note that BOSL2 has a highly optimized implementation of beziers within
OpenSCAD.

If you don't want to represent "all possible shapes" then what do you
want to represent?  How is your problem constrained or limited?  I'm
interested in being able to represent a broad range of shapes.  (All
possible shapes may be asking a lot.)  But the idea would be that you
aren't constrained when trying to design a shape where you hit a brick wall
because the implementation just can't do anything close to what you want.
Your reference to tool paths makes me wonder if you're thinking in some
more constrained problem domain.

Generally when people use cubic beziers they use a sequence of them, not
just one.  This may be what you're thinking of with reference to
"subdividing".  But if you're doing this for surfaces rather than curves,
it seems like there are complicated issues with joining everything together
to create a valid surface without holes.  Note that B-splines may be
easier to use because you can more easily force them to go through desired
points or control the degree of smoothness.  A B-spline implementation is
something I've been planning to look into.  But it doesn't address the
higher level question of how to put it all together to make surfaces.

On Thu, Jun 6, 2024 at 9:08 PM Sanjeev Prabhakar via Discuss <
discuss@lists.openscad.org> wrote:

Bezier has a well defined formula, whichbworks for both 2d and 3d
equally

You can refer this wiki
https://en.m.wikipedia.org/wiki/B%C3%A9zier_curve

Go to the degree elevation section

But if you need a specific radius curve or fillet, I don't think bezier
will work.

On Fri, 7 Jun, 2024, 3:58 am William F. Adams via Discuss, <
discuss@lists.openscad.org> wrote:

My thanks to everyone's input and thoughts.

After thinking about this a bit, I believe that the following
attributes would be desirable/necessary:

  • concise --- a given Bézier curve should be represented by just its
    coordinates, so two on-curve points, two off-curve points, each with a pair
    of coordinates
  • For a given shape/region it will need to be possible to have a
    matching definition exactly match up with it so that one could piece
    together a larger more complex shape from smaller/simpler regions
  • similarly it will be necessary for it to be possible to sub-divide a
    defined region --- for example it should be possible if one had 4 adjacent
    regions, then the four quadrants at the intersection of the four regions
    could be used to construct a new region --- is it possible to derive a new Bézier
    curve from half of two other curves?

It seems to me that for the three planes:

  • XY
  • XZ
  • ZY

it should be possible to have three Bézier curves
(left-most/right-most or front-back or top/bottom for two, and a mid-line
for the third), so any given region should be definable by:

3 * planes * 3 * Bézier curves * (2 on-curve points + 2 off-curve
points) == 36 coordinate pairs

which is a marked contrast to representations such as:

https://github.com/DavidPhillipOster/Teapot

I'm going to make a note on all this and will come back to it when I
get a chance, but of course, I'd be delighted if someone else took this up.

William

--
Sphinx of black quartz, judge my vow.
https://designinto3d.com/


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 have made a small video of impact of control points on the bezier https://youtu.be/lPnyrEYest0 On Fri, 7 Jun 2024 at 08:48, Sanjeev Prabhakar <sprabhakar2006@gmail.com> wrote: > I think this needs a little more explanation, but mainly "degree of > elevation" means how many control points you have in the main curve. With > more control points the bezier curve will be near to the original curve and > that I think is very important in many cases. > > I will explain this with some diagrams, maybe today evening once I am back > from the office. > > Thanks > > > On Fri, 7 Jun 2024 at 07:56, Adrian Mariano via Discuss < > discuss@lists.openscad.org> wrote: > >> A bezier curve cannot produce a circle, so if you need a circular arc you >> can't get it with a bezier. You can approximate circles. I never tried to >> figure out a way to define an approximate radius when doing roundings with >> beziers, because it seemed to me that in most cases, using other ways of >> measuring the fillet are more intuitive anyway, and directly translatable >> to beziers. >> >> I'm not sure what degree elevation has to do with this conversation. The >> need for higher degree would be driven by a need to meet additional >> constraints, like G2 continuity, and that requires building a bezier that >> is naturally defined at the higher degree, not elevating to a higher >> degree. It conflicts with the stated requirement that beziers are >> represented by only 4 points. >> >> Note that BOSL2 has a highly optimized implementation of beziers within >> OpenSCAD. >> >> If you don't want to represent "all possible shapes" then what do you >> want to represent? How is your problem constrained or limited? I'm >> interested in being able to represent a broad range of shapes. (All >> possible shapes may be asking a lot.) But the idea would be that you >> aren't constrained when trying to design a shape where you hit a brick wall >> because the implementation just can't do anything close to what you want. >> Your reference to tool paths makes me wonder if you're thinking in some >> more constrained problem domain. >> >> Generally when people use cubic beziers they use a sequence of them, not >> just one. This may be what you're thinking of with reference to >> "subdividing". But if you're doing this for surfaces rather than curves, >> it seems like there are complicated issues with joining everything together >> to create a valid surface without holes. Note that B-splines may be >> easier to use because you can more easily force them to go through desired >> points or control the degree of smoothness. A B-spline implementation is >> something I've been planning to look into. But it doesn't address the >> higher level question of how to put it all together to make surfaces. >> >> On Thu, Jun 6, 2024 at 9:08 PM Sanjeev Prabhakar via Discuss < >> discuss@lists.openscad.org> wrote: >> >>> Bezier has a well defined formula, whichbworks for both 2d and 3d >>> equally >>> >>> You can refer this wiki >>> https://en.m.wikipedia.org/wiki/B%C3%A9zier_curve >>> >>> Go to the degree elevation section >>> >>> But if you need a specific radius curve or fillet, I don't think bezier >>> will work. >>> >>> On Fri, 7 Jun, 2024, 3:58 am William F. Adams via Discuss, < >>> discuss@lists.openscad.org> wrote: >>> >>>> My thanks to everyone's input and thoughts. >>>> >>>> After thinking about this a bit, I believe that the following >>>> attributes would be desirable/necessary: >>>> >>>> - concise --- a given Bézier curve should be represented by just its >>>> coordinates, so two on-curve points, two off-curve points, each with a pair >>>> of coordinates >>>> - For a given shape/region it will need to be possible to have a >>>> matching definition exactly match up with it so that one could piece >>>> together a larger more complex shape from smaller/simpler regions >>>> - similarly it will be necessary for it to be possible to sub-divide a >>>> defined region --- for example it should be possible if one had 4 adjacent >>>> regions, then the four quadrants at the intersection of the four regions >>>> could be used to construct a new region --- is it possible to derive a new Bézier >>>> curve from half of two other curves? >>>> >>>> It seems to me that for the three planes: >>>> >>>> - XY >>>> - XZ >>>> - ZY >>>> >>>> it should be possible to have three Bézier curves >>>> (left-most/right-most or front-back or top/bottom for two, and a mid-line >>>> for the third), so any given region should be definable by: >>>> >>>> 3 * planes * 3 * Bézier curves * (2 on-curve points + 2 off-curve >>>> points) == 36 coordinate pairs >>>> >>>> which is a marked contrast to representations such as: >>>> >>>> https://github.com/DavidPhillipOster/Teapot >>>> >>>> >>>> I'm going to make a note on all this and will come back to it when I >>>> get a chance, but of course, I'd be delighted if someone else took this up. >>>> >>>> William >>>> >>>> -- >>>> Sphinx of black quartz, judge my vow. >>>> https://designinto3d.com/ >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> 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 >> >