Jon, IMHO the easiest way to consider the difference between beziers and
bsplines is that every knot(control point) on the bezier curve will
effect all of the line. So even making a small adjustment to an end
control point will (minimally) affect the curve a long way away. But
bsplines affect the curve only locally either side of the control point.
This makes it easier to control the curve. Nurbs (non-uniform bsplines)
are bsplines too. there are numerous basis functions for splines but
they have this similar property.
Parkinbots lib is great but many people (myself included) have
difficulty controlling it.
The maker.js and snap.js libs look great (and the other openscad in a
browser variants) if you're doing it all procedurally in a browser or
node.js system.
If you're manually doing it - I still recommend Inkscape, the openscad
export function and some openscad code for the end result.
As usual - YMMV.
On 10/25/2017 12:44 AM, jon wrote:
I often feel like a child among graduate students with you guys. I
thought what I was trying to do was simple (create a smooth exterior
curve for the guitar body) and all I needed was a "smoothing function"
of some sort. I do not understand the difference between Bezier and
splines: they both are magic to me. But Bezier appears to work to
smooth a curved line on a plane, while Parkinbot's splines appear to
work on a 3D surface. Is there a way to use Parkinbot's splines for
the simpler line-on-a-plane case?
Sorry for being so clueless.
Jon
On 10/23/2017 11:39 AM, jon wrote:
I am toying around with modeling an electric guitar body in OpenSCAD.
Google "Gibson SG" for an idea about the body shape. In order to
create the shape, I need between 10 and 20 control points (for one
side of the guitar body: the other side is [fortunately] a mirror
image). I found some code that will handle 4 control points, and some
that will handle 8, but nothing that will handle "n" points. I
suppose I could try to do this with a series of 4-point or 8 point
curves, but would prefer to do it with one curve.
Any insights into this? My quick perusal of the existing code implies
that one needs "n" hand-coded functions when handling "n" points,
which is why the previous authors went with fixed numbers of 4 and 8.
I grabbed a photo of a Gibson SG from gibson.com and had no trouble at
all outlining the body with Bezier curves. On my first try it took
twelve curves, but a second try dropped it to nine, and I suspect I
could knock off another one or two depending on how one treated the
interface with the neck.
I did it with Corel Draw, because that's what I'm familiar with, but I
expect you could do the same with Inkscape. I would have to read up on
SVG, but it looks like it wouldn't be hard to extract the values out of
the SVG and turn them into OpenSCAD source, if that's preferable.
This is a 2-D representation of the outline. A full 3D representation
is beyond me.
When I did that, I didn't bother keeping it within the bounds of a page,
because I was just interested in the shape. But when the message came
back to my mailbox, I see that my mail client displayed only the part on
the page, so here's a version that's rotated and scaled to fit onto a
page. Hopefully it will display properly in a mail client.