discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

NopSCADlib arc_points

FH
Father Horton
Sat, Feb 5, 2022 4:39 AM

I'm hoping to use the sweep function, but along the way I need to use
arc_points and it's not clear to me what the arguments do, even after
looking at the source..

r = radius of the arc
a = ?
al = arc length in degrees?

arc_points(r, a = [90, 0, 180], al = 90)

Any insight?

I'm hoping to use the sweep function, but along the way I need to use arc_points and it's not clear to me what the arguments do, even after looking at the source.. r = radius of the arc a = ? al = arc length in degrees? arc_points(r, a = [90, 0, 180], al = 90) Any insight?
DP
David Phillip Oster
Sat, Feb 5, 2022 5:56 AM

a is passed to rotate(), defined in maths.scad in NopSCADlib. There, it
says: a can be a vector of three angles…

On Fri, Feb 4, 2022 at 8:40 PM Father Horton fatherhorton@gmail.com wrote:

I'm hoping to use the sweep function, but along the way I need to use
arc_points and it's not clear to me what the arguments do, even after
looking at the source..

r = radius of the arc
a = ?
al = arc length in degrees?

arc_points(r, a = [90, 0, 180], al = 90)

Any insight?


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

a is passed to rotate(), defined in maths.scad in NopSCADlib. There, it says: `a` can be a vector of three angles… On Fri, Feb 4, 2022 at 8:40 PM Father Horton <fatherhorton@gmail.com> wrote: > I'm hoping to use the sweep function, but along the way I need to use > arc_points and it's not clear to me what the arguments do, even after > looking at the source.. > > r = radius of the arc > a = ? > al = arc length in degrees? > > arc_points(r, a = [90, 0, 180], al = 90) > > Any insight? > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
SP
Sanjeev Prabhakar
Sat, Feb 5, 2022 8:36 AM

following function can generate arc points as well

function
arc(radius,ang1=0,ang2=355,cp=[0,0],s=20)=[for(i=[ang1:(ang2-ang1)/s:ang2])cp+[radiuscos(i),radiussin(i)]];

where:
radius: Radius of the arc
ang1: start angle referenced from positive x-axis
ang2: ending of arc angle again referenced from positive x-axis
s: number of segments required in the arc

On Sat, 5 Feb 2022 at 10:10, Father Horton fatherhorton@gmail.com wrote:

I'm hoping to use the sweep function, but along the way I need to use
arc_points and it's not clear to me what the arguments do, even after
looking at the source..

r = radius of the arc
a = ?
al = arc length in degrees?

arc_points(r, a = [90, 0, 180], al = 90)

Any insight?


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

following function can generate arc points as well function arc(radius,ang1=0,ang2=355,cp=[0,0],s=20)=[for(i=[ang1:(ang2-ang1)/s:ang2])cp+[radius*cos(i),radius*sin(i)]]; where: radius: Radius of the arc ang1: start angle referenced from positive x-axis ang2: ending of arc angle again referenced from positive x-axis s: number of segments required in the arc On Sat, 5 Feb 2022 at 10:10, Father Horton <fatherhorton@gmail.com> wrote: > I'm hoping to use the sweep function, but along the way I need to use > arc_points and it's not clear to me what the arguments do, even after > looking at the source.. > > r = radius of the arc > a = ? > al = arc length in degrees? > > arc_points(r, a = [90, 0, 180], al = 90) > > Any insight? > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
NH
nop head
Sat, Feb 5, 2022 9:27 AM

Yes I use arc_points for generating cable runs but I find it difficult to
get the rotate parameter correct myself, as I do all multi axis
rotates in OpenSCAD and often resort to trial and error. Sometimes in
desperation I work out the transformation matrix by hand as I know I want z
= -x, etc, and then pass the matrix of 1s and -1s to euler() to give me the
rotation parameters. I did that while designing this.

[image: image.png]

I am currently working on an easier way to specify a wire path, with just
one angle around the axis of the wire and an optional second one to specify
a bend that is not 90 degrees. Then I will have a list of those separated
by lengths of the straight sections.

On Sat, 5 Feb 2022 at 08:36, Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

following function can generate arc points as well

function
arc(radius,ang1=0,ang2=355,cp=[0,0],s=20)=[for(i=[ang1:(ang2-ang1)/s:ang2])cp+[radiuscos(i),radiussin(i)]];

where:
radius: Radius of the arc
ang1: start angle referenced from positive x-axis
ang2: ending of arc angle again referenced from positive x-axis
s: number of segments required in the arc

On Sat, 5 Feb 2022 at 10:10, Father Horton fatherhorton@gmail.com wrote:

I'm hoping to use the sweep function, but along the way I need to use
arc_points and it's not clear to me what the arguments do, even after
looking at the source..

r = radius of the arc
a = ?
al = arc length in degrees?

arc_points(r, a = [90, 0, 180], al = 90)

Any insight?


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

Yes I use arc_points for generating cable runs but I find it difficult to get the rotate parameter correct myself, as I do all multi axis rotates in OpenSCAD and often resort to trial and error. Sometimes in desperation I work out the transformation matrix by hand as I know I want z = -x, etc, and then pass the matrix of 1s and -1s to euler() to give me the rotation parameters. I did that while designing this. [image: image.png] I am currently working on an easier way to specify a wire path, with just one angle around the axis of the wire and an optional second one to specify a bend that is not 90 degrees. Then I will have a list of those separated by lengths of the straight sections. On Sat, 5 Feb 2022 at 08:36, Sanjeev Prabhakar <sprabhakar2006@gmail.com> wrote: > following function can generate arc points as well > > function > arc(radius,ang1=0,ang2=355,cp=[0,0],s=20)=[for(i=[ang1:(ang2-ang1)/s:ang2])cp+[radius*cos(i),radius*sin(i)]]; > > where: > radius: Radius of the arc > ang1: start angle referenced from positive x-axis > ang2: ending of arc angle again referenced from positive x-axis > s: number of segments required in the arc > > > On Sat, 5 Feb 2022 at 10:10, Father Horton <fatherhorton@gmail.com> wrote: > >> I'm hoping to use the sweep function, but along the way I need to use >> arc_points and it's not clear to me what the arguments do, even after >> looking at the source.. >> >> r = radius of the arc >> a = ? >> al = arc length in degrees? >> >> arc_points(r, a = [90, 0, 180], al = 90) >> >> Any insight? >> _______________________________________________ >> 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 >
FH
Father Horton
Sat, Feb 5, 2022 1:08 PM

Thank you all! I think the standalone arc function is the most
straightforward solution here.

Thank you all! I think the standalone arc function is the most straightforward solution here.
AM
Adrian Mariano
Sat, Feb 5, 2022 1:30 PM

Why not specify wire paths by giving a list of points ignoring the curves
and then a radius for curves (or list of radii if you want it to vary).
It's easy to write some code to add the curves to the path without any
crazy trial and error.

On Sat, Feb 5, 2022 at 4:28 AM nop head nop.head@gmail.com wrote:

Yes I use arc_points for generating cable runs but I find it difficult to
get the rotate parameter correct myself, as I do all multi axis
rotates in OpenSCAD and often resort to trial and error. Sometimes in
desperation I work out the transformation matrix by hand as I know I want z
= -x, etc, and then pass the matrix of 1s and -1s to euler() to give me the
rotation parameters. I did that while designing this.

[image: image.png]

I am currently working on an easier way to specify a wire path, with just
one angle around the axis of the wire and an optional second one to specify
a bend that is not 90 degrees. Then I will have a list of those separated
by lengths of the straight sections.

On Sat, 5 Feb 2022 at 08:36, Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

following function can generate arc points as well

function
arc(radius,ang1=0,ang2=355,cp=[0,0],s=20)=[for(i=[ang1:(ang2-ang1)/s:ang2])cp+[radiuscos(i),radiussin(i)]];

where:
radius: Radius of the arc
ang1: start angle referenced from positive x-axis
ang2: ending of arc angle again referenced from positive x-axis
s: number of segments required in the arc

On Sat, 5 Feb 2022 at 10:10, Father Horton fatherhorton@gmail.com
wrote:

I'm hoping to use the sweep function, but along the way I need to use
arc_points and it's not clear to me what the arguments do, even after
looking at the source..

r = radius of the arc
a = ?
al = arc length in degrees?

arc_points(r, a = [90, 0, 180], al = 90)

Any insight?


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

Why not specify wire paths by giving a list of points ignoring the curves and then a radius for curves (or list of radii if you want it to vary). It's easy to write some code to add the curves to the path without any crazy trial and error. On Sat, Feb 5, 2022 at 4:28 AM nop head <nop.head@gmail.com> wrote: > Yes I use arc_points for generating cable runs but I find it difficult to > get the rotate parameter correct myself, as I do all multi axis > rotates in OpenSCAD and often resort to trial and error. Sometimes in > desperation I work out the transformation matrix by hand as I know I want z > = -x, etc, and then pass the matrix of 1s and -1s to euler() to give me the > rotation parameters. I did that while designing this. > > [image: image.png] > > I am currently working on an easier way to specify a wire path, with just > one angle around the axis of the wire and an optional second one to specify > a bend that is not 90 degrees. Then I will have a list of those separated > by lengths of the straight sections. > > > > On Sat, 5 Feb 2022 at 08:36, Sanjeev Prabhakar <sprabhakar2006@gmail.com> > wrote: > >> following function can generate arc points as well >> >> function >> arc(radius,ang1=0,ang2=355,cp=[0,0],s=20)=[for(i=[ang1:(ang2-ang1)/s:ang2])cp+[radius*cos(i),radius*sin(i)]]; >> >> where: >> radius: Radius of the arc >> ang1: start angle referenced from positive x-axis >> ang2: ending of arc angle again referenced from positive x-axis >> s: number of segments required in the arc >> >> >> On Sat, 5 Feb 2022 at 10:10, Father Horton <fatherhorton@gmail.com> >> wrote: >> >>> I'm hoping to use the sweep function, but along the way I need to use >>> arc_points and it's not clear to me what the arguments do, even after >>> looking at the source.. >>> >>> r = radius of the arc >>> a = ? >>> al = arc length in degrees? >>> >>> arc_points(r, a = [90, 0, 180], al = 90) >>> >>> Any insight? >>> _______________________________________________ >>> 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 >
NH
nop head
Sat, Feb 5, 2022 4:43 PM

Yes I considered that but it creates conflicts to specify both the end
points and the radii. Perhaps start, end, radius,  next end radius, next
end radius, etc works.

On Sat, 5 Feb 2022 at 13:55, Adrian Mariano avm4@cornell.edu wrote:

Why not specify wire paths by giving a list of points ignoring the curves
and then a radius for curves (or list of radii if you want it to vary).
It's easy to write some code to add the curves to the path without any
crazy trial and error.

On Sat, Feb 5, 2022 at 4:28 AM nop head nop.head@gmail.com wrote:

Yes I use arc_points for generating cable runs but I find it difficult to
get the rotate parameter correct myself, as I do all multi axis
rotates in OpenSCAD and often resort to trial and error. Sometimes in
desperation I work out the transformation matrix by hand as I know I want z
= -x, etc, and then pass the matrix of 1s and -1s to euler() to give me the
rotation parameters. I did that while designing this.

[image: image.png]

I am currently working on an easier way to specify a wire path, with just
one angle around the axis of the wire and an optional second one to specify
a bend that is not 90 degrees. Then I will have a list of those separated
by lengths of the straight sections.

On Sat, 5 Feb 2022 at 08:36, Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

following function can generate arc points as well

function
arc(radius,ang1=0,ang2=355,cp=[0,0],s=20)=[for(i=[ang1:(ang2-ang1)/s:ang2])cp+[radiuscos(i),radiussin(i)]];

where:
radius: Radius of the arc
ang1: start angle referenced from positive x-axis
ang2: ending of arc angle again referenced from positive x-axis
s: number of segments required in the arc

On Sat, 5 Feb 2022 at 10:10, Father Horton fatherhorton@gmail.com
wrote:

I'm hoping to use the sweep function, but along the way I need to use
arc_points and it's not clear to me what the arguments do, even after
looking at the source..

r = radius of the arc
a = ?
al = arc length in degrees?

arc_points(r, a = [90, 0, 180], al = 90)

Any insight?


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


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


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


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

Yes I considered that but it creates conflicts to specify both the end points and the radii. Perhaps start, end, radius, next end radius, next end radius, etc works. On Sat, 5 Feb 2022 at 13:55, Adrian Mariano <avm4@cornell.edu> wrote: > Why not specify wire paths by giving a list of points ignoring the curves > and then a radius for curves (or list of radii if you want it to vary). > It's easy to write some code to add the curves to the path without any > crazy trial and error. > > On Sat, Feb 5, 2022 at 4:28 AM nop head <nop.head@gmail.com> wrote: > >> Yes I use arc_points for generating cable runs but I find it difficult to >> get the rotate parameter correct myself, as I do all multi axis >> rotates in OpenSCAD and often resort to trial and error. Sometimes in >> desperation I work out the transformation matrix by hand as I know I want z >> = -x, etc, and then pass the matrix of 1s and -1s to euler() to give me the >> rotation parameters. I did that while designing this. >> >> [image: image.png] >> >> I am currently working on an easier way to specify a wire path, with just >> one angle around the axis of the wire and an optional second one to specify >> a bend that is not 90 degrees. Then I will have a list of those separated >> by lengths of the straight sections. >> >> >> >> On Sat, 5 Feb 2022 at 08:36, Sanjeev Prabhakar <sprabhakar2006@gmail.com> >> wrote: >> >>> following function can generate arc points as well >>> >>> function >>> arc(radius,ang1=0,ang2=355,cp=[0,0],s=20)=[for(i=[ang1:(ang2-ang1)/s:ang2])cp+[radius*cos(i),radius*sin(i)]]; >>> >>> where: >>> radius: Radius of the arc >>> ang1: start angle referenced from positive x-axis >>> ang2: ending of arc angle again referenced from positive x-axis >>> s: number of segments required in the arc >>> >>> >>> On Sat, 5 Feb 2022 at 10:10, Father Horton <fatherhorton@gmail.com> >>> wrote: >>> >>>> I'm hoping to use the sweep function, but along the way I need to use >>>> arc_points and it's not clear to me what the arguments do, even after >>>> looking at the source.. >>>> >>>> r = radius of the arc >>>> a = ? >>>> al = arc length in degrees? >>>> >>>> arc_points(r, a = [90, 0, 180], al = 90) >>>> >>>> Any insight? >>>> _______________________________________________ >>>> OpenSCAD mailing list >>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
AM
Adrian Mariano
Sat, Feb 5, 2022 4:59 PM

I don't understand the conflict.  This is how the BOSL2 wiring module
works.  You specify a list of points defining the wire run assuming wires
make sharp bends and you give a radius for the corners.  So wires go from
p[0] to p[1] to p[2] to p[3], ..., p[N].  And then you have radii at p[1],
p[2], p[3], up to P[N-1].

On Sat, Feb 5, 2022 at 11:44 AM nop head nop.head@gmail.com wrote:

Yes I considered that but it creates conflicts to specify both the end
points and the radii. Perhaps start, end, radius,  next end radius, next
end radius, etc works.

On Sat, 5 Feb 2022 at 13:55, Adrian Mariano avm4@cornell.edu wrote:

Why not specify wire paths by giving a list of points ignoring the curves
and then a radius for curves (or list of radii if you want it to vary).
It's easy to write some code to add the curves to the path without any
crazy trial and error.

On Sat, Feb 5, 2022 at 4:28 AM nop head nop.head@gmail.com wrote:

Yes I use arc_points for generating cable runs but I find it difficult
to get the rotate parameter correct myself, as I do all multi axis
rotates in OpenSCAD and often resort to trial and error. Sometimes in
desperation I work out the transformation matrix by hand as I know I want z
= -x, etc, and then pass the matrix of 1s and -1s to euler() to give me the
rotation parameters. I did that while designing this.

[image: image.png]

I am currently working on an easier way to specify a wire path, with
just one angle around the axis of the wire and an optional second one to
specify a bend that is not 90 degrees. Then I will have a list of those
separated by lengths of the straight sections.

On Sat, 5 Feb 2022 at 08:36, Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

following function can generate arc points as well

function
arc(radius,ang1=0,ang2=355,cp=[0,0],s=20)=[for(i=[ang1:(ang2-ang1)/s:ang2])cp+[radiuscos(i),radiussin(i)]];

where:
radius: Radius of the arc
ang1: start angle referenced from positive x-axis
ang2: ending of arc angle again referenced from positive x-axis
s: number of segments required in the arc

On Sat, 5 Feb 2022 at 10:10, Father Horton fatherhorton@gmail.com
wrote:

I'm hoping to use the sweep function, but along the way I need to use
arc_points and it's not clear to me what the arguments do, even after
looking at the source..

r = radius of the arc
a = ?
al = arc length in degrees?

arc_points(r, a = [90, 0, 180], al = 90)

Any insight?


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


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


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


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


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

I don't understand the conflict. This is how the BOSL2 wiring module works. You specify a list of points defining the wire run assuming wires make sharp bends and you give a radius for the corners. So wires go from p[0] to p[1] to p[2] to p[3], ..., p[N]. And then you have radii at p[1], p[2], p[3], up to P[N-1]. On Sat, Feb 5, 2022 at 11:44 AM nop head <nop.head@gmail.com> wrote: > Yes I considered that but it creates conflicts to specify both the end > points and the radii. Perhaps start, end, radius, next end radius, next > end radius, etc works. > > On Sat, 5 Feb 2022 at 13:55, Adrian Mariano <avm4@cornell.edu> wrote: > >> Why not specify wire paths by giving a list of points ignoring the curves >> and then a radius for curves (or list of radii if you want it to vary). >> It's easy to write some code to add the curves to the path without any >> crazy trial and error. >> >> On Sat, Feb 5, 2022 at 4:28 AM nop head <nop.head@gmail.com> wrote: >> >>> Yes I use arc_points for generating cable runs but I find it difficult >>> to get the rotate parameter correct myself, as I do all multi axis >>> rotates in OpenSCAD and often resort to trial and error. Sometimes in >>> desperation I work out the transformation matrix by hand as I know I want z >>> = -x, etc, and then pass the matrix of 1s and -1s to euler() to give me the >>> rotation parameters. I did that while designing this. >>> >>> [image: image.png] >>> >>> I am currently working on an easier way to specify a wire path, with >>> just one angle around the axis of the wire and an optional second one to >>> specify a bend that is not 90 degrees. Then I will have a list of those >>> separated by lengths of the straight sections. >>> >>> >>> >>> On Sat, 5 Feb 2022 at 08:36, Sanjeev Prabhakar <sprabhakar2006@gmail.com> >>> wrote: >>> >>>> following function can generate arc points as well >>>> >>>> function >>>> arc(radius,ang1=0,ang2=355,cp=[0,0],s=20)=[for(i=[ang1:(ang2-ang1)/s:ang2])cp+[radius*cos(i),radius*sin(i)]]; >>>> >>>> where: >>>> radius: Radius of the arc >>>> ang1: start angle referenced from positive x-axis >>>> ang2: ending of arc angle again referenced from positive x-axis >>>> s: number of segments required in the arc >>>> >>>> >>>> On Sat, 5 Feb 2022 at 10:10, Father Horton <fatherhorton@gmail.com> >>>> wrote: >>>> >>>>> I'm hoping to use the sweep function, but along the way I need to use >>>>> arc_points and it's not clear to me what the arguments do, even after >>>>> looking at the source.. >>>>> >>>>> r = radius of the arc >>>>> a = ? >>>>> al = arc length in degrees? >>>>> >>>>> arc_points(r, a = [90, 0, 180], al = 90) >>>>> >>>>> Any insight? >>>>> _______________________________________________ >>>>> OpenSCAD mailing list >>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>>> >>>> _______________________________________________ >>>> OpenSCAD mailing list >>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
SP
Sanjeev Prabhakar
Sat, Feb 5, 2022 5:09 PM

The problem can happen when the length of the line is less than the radius
defined at 2 points (I mean r*tan(theta/2), where theta is the arc angle).
Then you have to decide to either reduce the radius or increase the length
(most likely the radius needs to be reduced)
. This is not a simple thing to do considering various lines and radiuses.

On Sat, 5 Feb 2022 at 22:30, Adrian Mariano avm4@cornell.edu wrote:

I don't understand the conflict.  This is how the BOSL2 wiring module
works.  You specify a list of points defining the wire run assuming wires
make sharp bends and you give a radius for the corners.  So wires go from
p[0] to p[1] to p[2] to p[3], ..., p[N].  And then you have radii at p[1],
p[2], p[3], up to P[N-1].

On Sat, Feb 5, 2022 at 11:44 AM nop head nop.head@gmail.com wrote:

Yes I considered that but it creates conflicts to specify both the end
points and the radii. Perhaps start, end, radius,  next end radius, next
end radius, etc works.

On Sat, 5 Feb 2022 at 13:55, Adrian Mariano avm4@cornell.edu wrote:

Why not specify wire paths by giving a list of points ignoring the
curves and then a radius for curves (or list of radii if you want it to
vary).  It's easy to write some code to add the curves to the path without
any crazy trial and error.

On Sat, Feb 5, 2022 at 4:28 AM nop head nop.head@gmail.com wrote:

Yes I use arc_points for generating cable runs but I find it difficult
to get the rotate parameter correct myself, as I do all multi axis
rotates in OpenSCAD and often resort to trial and error. Sometimes in
desperation I work out the transformation matrix by hand as I know I want z
= -x, etc, and then pass the matrix of 1s and -1s to euler() to give me the
rotation parameters. I did that while designing this.

[image: image.png]

I am currently working on an easier way to specify a wire path, with
just one angle around the axis of the wire and an optional second one to
specify a bend that is not 90 degrees. Then I will have a list of those
separated by lengths of the straight sections.

On Sat, 5 Feb 2022 at 08:36, Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:

following function can generate arc points as well

function
arc(radius,ang1=0,ang2=355,cp=[0,0],s=20)=[for(i=[ang1:(ang2-ang1)/s:ang2])cp+[radiuscos(i),radiussin(i)]];

where:
radius: Radius of the arc
ang1: start angle referenced from positive x-axis
ang2: ending of arc angle again referenced from positive x-axis
s: number of segments required in the arc

On Sat, 5 Feb 2022 at 10:10, Father Horton fatherhorton@gmail.com
wrote:

I'm hoping to use the sweep function, but along the way I need to use
arc_points and it's not clear to me what the arguments do, even after
looking at the source..

r = radius of the arc
a = ?
al = arc length in degrees?

arc_points(r, a = [90, 0, 180], al = 90)

Any insight?


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


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


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


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


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


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

The problem can happen when the length of the line is less than the radius defined at 2 points (I mean r*tan(theta/2), where theta is the arc angle). Then you have to decide to either reduce the radius or increase the length (most likely the radius needs to be reduced) . This is not a simple thing to do considering various lines and radiuses. On Sat, 5 Feb 2022 at 22:30, Adrian Mariano <avm4@cornell.edu> wrote: > I don't understand the conflict. This is how the BOSL2 wiring module > works. You specify a list of points defining the wire run assuming wires > make sharp bends and you give a radius for the corners. So wires go from > p[0] to p[1] to p[2] to p[3], ..., p[N]. And then you have radii at p[1], > p[2], p[3], up to P[N-1]. > > On Sat, Feb 5, 2022 at 11:44 AM nop head <nop.head@gmail.com> wrote: > >> Yes I considered that but it creates conflicts to specify both the end >> points and the radii. Perhaps start, end, radius, next end radius, next >> end radius, etc works. >> >> On Sat, 5 Feb 2022 at 13:55, Adrian Mariano <avm4@cornell.edu> wrote: >> >>> Why not specify wire paths by giving a list of points ignoring the >>> curves and then a radius for curves (or list of radii if you want it to >>> vary). It's easy to write some code to add the curves to the path without >>> any crazy trial and error. >>> >>> On Sat, Feb 5, 2022 at 4:28 AM nop head <nop.head@gmail.com> wrote: >>> >>>> Yes I use arc_points for generating cable runs but I find it difficult >>>> to get the rotate parameter correct myself, as I do all multi axis >>>> rotates in OpenSCAD and often resort to trial and error. Sometimes in >>>> desperation I work out the transformation matrix by hand as I know I want z >>>> = -x, etc, and then pass the matrix of 1s and -1s to euler() to give me the >>>> rotation parameters. I did that while designing this. >>>> >>>> [image: image.png] >>>> >>>> I am currently working on an easier way to specify a wire path, with >>>> just one angle around the axis of the wire and an optional second one to >>>> specify a bend that is not 90 degrees. Then I will have a list of those >>>> separated by lengths of the straight sections. >>>> >>>> >>>> >>>> On Sat, 5 Feb 2022 at 08:36, Sanjeev Prabhakar < >>>> sprabhakar2006@gmail.com> wrote: >>>> >>>>> following function can generate arc points as well >>>>> >>>>> function >>>>> arc(radius,ang1=0,ang2=355,cp=[0,0],s=20)=[for(i=[ang1:(ang2-ang1)/s:ang2])cp+[radius*cos(i),radius*sin(i)]]; >>>>> >>>>> where: >>>>> radius: Radius of the arc >>>>> ang1: start angle referenced from positive x-axis >>>>> ang2: ending of arc angle again referenced from positive x-axis >>>>> s: number of segments required in the arc >>>>> >>>>> >>>>> On Sat, 5 Feb 2022 at 10:10, Father Horton <fatherhorton@gmail.com> >>>>> wrote: >>>>> >>>>>> I'm hoping to use the sweep function, but along the way I need to use >>>>>> arc_points and it's not clear to me what the arguments do, even after >>>>>> looking at the source.. >>>>>> >>>>>> r = radius of the arc >>>>>> a = ? >>>>>> al = arc length in degrees? >>>>>> >>>>>> arc_points(r, a = [90, 0, 180], al = 90) >>>>>> >>>>>> Any insight? >>>>>> _______________________________________________ >>>>>> OpenSCAD mailing list >>>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>>>> >>>>> _______________________________________________ >>>>> OpenSCAD mailing list >>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>>> >>>> _______________________________________________ >>>> OpenSCAD mailing list >>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
J
jon
Sat, Feb 5, 2022 5:17 PM

In that situation, could the library cause an error, forcing the caller
to fix the parameters?  This would work fine if the call was generated
by a human, but if the call was deep in a library that thought it was
creating reasonable parameters, then things could get complex.  Well. 
They already would be complex.

On 2/5/2022 12:09 PM, Sanjeev Prabhakar wrote:

The problem can happen when the length of the line is less than the
radius defined at 2 points (I mean r*tan(theta/2), where theta is the
arc angle).
Then you have to decide to either reduce the radius or increase the
length (most likely the radius needs to be reduced)
. This is not a simple thing to do considering various lines and
radiuses.

On Sat, 5 Feb 2022 at 22:30, Adrian Mariano avm4@cornell.edu wrote:

 I don't understand the conflict.  This is how the BOSL2 wiring
 module works.  You specify a list of points defining the wire run
 assuming wires make sharp bends and you give a radius for the
 corners.  So wires go from p[0] to p[1] to p[2] to p[3], ...,
 p[N].  And then you have radii at p[1], p[2], p[3], up to P[N-1].

 On Sat, Feb 5, 2022 at 11:44 AM nop head <nop.head@gmail.com> wrote:

     Yes I considered that but it creates conflicts to specify both
     the end points and the radii. Perhaps start, end, radius, 
     next end radius, next end radius, etc works.
In that situation, could the library cause an error, forcing the caller to fix the parameters?  This would work fine if the call was generated by a human, but if the call was deep in a library that thought it was creating reasonable parameters, then things could get complex.  Well.  They already would be complex. On 2/5/2022 12:09 PM, Sanjeev Prabhakar wrote: > The problem can happen when the length of the line is less than the > radius defined at 2 points (I mean r*tan(theta/2), where theta is the > arc angle). > Then you have to decide to either reduce the radius or increase the > length (most likely the radius needs to be reduced) > . This is not a simple thing to do considering various lines and > radiuses. > > On Sat, 5 Feb 2022 at 22:30, Adrian Mariano <avm4@cornell.edu> wrote: > > I don't understand the conflict.  This is how the BOSL2 wiring > module works.  You specify a list of points defining the wire run > assuming wires make sharp bends and you give a radius for the > corners.  So wires go from p[0] to p[1] to p[2] to p[3], ..., > p[N].  And then you have radii at p[1], p[2], p[3], up to P[N-1]. > > On Sat, Feb 5, 2022 at 11:44 AM nop head <nop.head@gmail.com> wrote: > > Yes I considered that but it creates conflicts to specify both > the end points and the radii. Perhaps start, end, radius,  > next end radius, next end radius, etc works. >