I examined neck1200.scad. The problem reported about errors compiling is
fixed by removing the "use" statements.
However, I'm a little confused about the intent of the neck1200 code.
There is a list of points in 2d described as "diameter". It appears that
maybe the second value is the position and the first value the diameter at
that position. This point list is then operated on using
path_pos_from_start. But that doesn't make sense, because the data is not
actually a path in 2d. You should be interpolating just on the second
coordinate to find position. I would probably do this with lookup()----but
the coordinates would need to be swapped first.
The code for creating the actual shape is a chain hull of cylinders. I
would do this with sweep. I would use path_sweep with the transforms=true
option to get a list of transform matrices. I would apply the scales to
those and then invoke sweep().
For putting objects on the surface you should be able to do it with just a
call to path_spread(), I think. Note that path_cut is not a drop in
replacement for path_pos_from_start(). The old function returned an index
into the path plus a fraction along the next path segment. The new
function takes a list of cut points and returns all the paths cut at those
points, so you can then extract the ends that you need directly.
Docs for path_cut:
https://github.com/revarbat/BOSL2/wiki/paths.scad#function-path_cut
If you just want the code to work, here's the old function:
function path_pos_from_start(path,length,closed=false,_d=0,_i=0) =
let (lp = len(path))
_i >= lp - (closed?0:1)? undef :
let (l = norm(path[(_i+1)%lp]-path[_i]))
_d+l <= length? path_pos_from_start(path,length,closed,_d+l,_i+1) :
[_i, (length-_d)/l];
On Tue, Oct 11, 2022 at 5:02 AM Mr Yura Volodin via Discuss <
discuss@lists.openscad.org> wrote:
---------- Forwarded message ----------
From: Mr Yura Volodin yur_vol@yahoo.com
To: OpenSCAD general discussion Mailing-list discuss@lists.openscad.org
Cc:
Bcc:
Date: Tue, 11 Oct 2022 09:01:36 +0000 (UTC)
Subject: [OpenSCAD] Re: Where is "path_pos_from_start" in BOLS2 ?
Direct replacement does not work. see attachment
More info:
To reverse engineering saxophones for fdm 3dprinting I use two curve
approach.
One curve is path to "extrude" and second is - diameters along this path.
After bulding tube I place toneholes, posts and etc, defined by length
from top of tube.
So I need function to return diameter at given length and angle to rotate
item I want to place
I draw curve manually in MOI3D then save as polyline dxf then convert to
openscad polyline with dxfwread.exe tool.
I almost solved all the above, but have a feel that there is more elegant
solution.
Equal spacing along the curve is overkill on straight segments. BSpline
examples in this maillist seems to be useful but I didnot realize how to
implement.
I still didnot understand why length of the resulting tube depends from
quantization number and how to avoid its changing.
On Tuesday, October 11, 2022 at 12:55:06 AM GMT+3, Adrian Mariano <
avm4@cornell.edu> wrote:
I believe that path_pos_from_start was eliminated because it was redundant
with path_cut. Can path_cut do what you need?
On Mon, Oct 10, 2022 at 11:56 AM Mr Yura Volodin via Discuss <
discuss@lists.openscad.org> wrote:
---------- Forwarded message ----------
From: Mr Yura Volodin yur_vol@yahoo.com
To: Mr Yura Volodin via Discuss discuss@lists.openscad.org
Cc:
Bcc:
Date: Mon, 10 Oct 2022 15:55:25 +0000 (UTC)
Subject: [OpenSCAD] Where is "path_pos_from_start" in BOLS2 ?
I use this function in BOLS2 from 2020 for finding point to place an item
on curved tube.
It is absent in newer BOLS2.
What I need to use insteed ?
SY, Yuri
---------- Forwarded message ----------
From: Mr Yura Volodin via Discuss discuss@lists.openscad.org
To: Mr Yura Volodin via Discuss discuss@lists.openscad.org
Cc: Mr Yura Volodin yur_vol@yahoo.com
Bcc:
Date: Mon, 10 Oct 2022 15:55:25 +0000 (UTC)
Subject: [OpenSCAD] Where is "path_pos_from_start" in BOLS2 ?
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
---------- Forwarded message ----------
From: Mr Yura Volodin via Discuss discuss@lists.openscad.org
To: OpenSCAD general discussion Mailing-list discuss@lists.openscad.org
Cc: Mr Yura Volodin yur_vol@yahoo.com
Bcc:
Date: Tue, 11 Oct 2022 09:01:36 +0000 (UTC)
Subject: [OpenSCAD] Re: Where is "path_pos_from_start" in BOLS2 ?
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
As I understand interpolation is done automatically inside the BOLS2 functions. Dont know what exactly method is implemented.
You set number of equally spaced interpolation points only for generating tube. It does not depend from how input path set.So you can find a point at given length.
For tangent/normal rotating items I set rotate_children=true
On Wednesday, October 12, 2022 at 02:00:39 AM GMT+3, Adrian Mariano <avm4@cornell.edu> wrote:
I examined neck1200.scad. The problem reported about errors compiling is fixed by removing the "use" statements.
However, I'm a little confused about the intent of the neck1200 code. There is a list of points in 2d described as "diameter". It appears that maybe the second value is the position and the first value the diameter at that position. This point list is then operated on using path_pos_from_start. But that doesn't make sense, because the data is not actually a path in 2d. You should be interpolating just on the second coordinate to find position. I would probably do this with lookup()----but the coordinates would need to be swapped first.
The code for creating the actual shape is a chain hull of cylinders. I would do this with sweep. I would use path_sweep with the transforms=true option to get a list of transform matrices. I would apply the scales to those and then invoke sweep().
For putting objects on the surface you should be able to do it with just a call to path_spread(), I think. Note that path_cut is not a drop in replacement for path_pos_from_start(). The old function returned an index into the path plus a fraction along the next path segment. The new function takes a list of cut points and returns all the paths cut at those points, so you can then extract the ends that you need directly.
Docs for path_cut:
https://github.com/revarbat/BOSL2/wiki/paths.scad#function-path_cut
If you just want the code to work, here's the old function:
function path_pos_from_start(path,length,closed=false,_d=0,_i=0) =
let (lp = len(path))
_i >= lp - (closed?0:1)? undef :
let (l = norm(path[(_i+1)%lp]-path[_i]))
_d+l <= length? path_pos_from_start(path,length,closed,_d+l,_i+1) :
[_i, (length-_d)/l];
On Tue, Oct 11, 2022 at 5:02 AM Mr Yura Volodin via Discuss discuss@lists.openscad.org wrote:
---------- Forwarded message ----------
From: Mr Yura Volodin yur_vol@yahoo.com
To: OpenSCAD general discussion Mailing-list discuss@lists.openscad.org
Cc:
Bcc:
Date: Tue, 11 Oct 2022 09:01:36 +0000 (UTC)
Subject: [OpenSCAD] Re: Where is "path_pos_from_start" in BOLS2 ?
Direct replacement does not work. see attachment
More info:To reverse engineering saxophones for fdm 3dprinting I use two curve approach.One curve is path to "extrude" and second is - diameters along this path.After bulding tube I place toneholes, posts and etc, defined by length from top of tube.So I need function to return diameter at given length and angle to rotate item I want to placeI draw curve manually in MOI3D then save as polyline dxf then convert to openscad polyline with dxfwread.exe tool.I almost solved all the above, but have a feel that there is more elegant solution.
Equal spacing along the curve is overkill on straight segments. BSpline examples in this maillist seems to be useful but I didnot realize how to implement.I still didnot understand why length of the resulting tube depends from quantization number and how to avoid its changing.
On Tuesday, October 11, 2022 at 12:55:06 AM GMT+3, Adrian Mariano <avm4@cornell.edu> wrote:
I believe that path_pos_from_start was eliminated because it was redundant with path_cut. Can path_cut do what you need?
On Mon, Oct 10, 2022 at 11:56 AM Mr Yura Volodin via Discuss discuss@lists.openscad.org wrote:
---------- Forwarded message ----------
From: Mr Yura Volodin yur_vol@yahoo.com
To: Mr Yura Volodin via Discuss discuss@lists.openscad.org
Cc:
Bcc:
Date: Mon, 10 Oct 2022 15:55:25 +0000 (UTC)
Subject: [OpenSCAD] Where is "path_pos_from_start" in BOLS2 ?
I use this function in BOLS2 from 2020 for finding point to place an item on curved tube.It is absent in newer BOLS2.
What I need to use insteed ?
SY, Yuri
---------- Forwarded message ----------
From: Mr Yura Volodin via Discuss discuss@lists.openscad.org
To: Mr Yura Volodin via Discuss discuss@lists.openscad.org
Cc: Mr Yura Volodin yur_vol@yahoo.com
Bcc:
Date: Mon, 10 Oct 2022 15:55:25 +0000 (UTC)
Subject: [OpenSCAD] Where is "path_pos_from_start" in BOLS2 ?
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
---------- Forwarded message ----------
From: Mr Yura Volodin via Discuss discuss@lists.openscad.org
To: OpenSCAD general discussion Mailing-list discuss@lists.openscad.org
Cc: Mr Yura Volodin yur_vol@yahoo.com
Bcc:
Date: Tue, 11 Oct 2022 09:01:36 +0000 (UTC)
Subject: [OpenSCAD] Re: Where is "path_pos_from_start" in BOLS2 ?
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