To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 7984
7983  |  7985
Subject: 
Re: Problem with LDraw-Mode and LDDP Bezier Curve plugin
Newsgroups: 
lugnet.cad.dev
Date: 
Mon, 21 Oct 2002 18:03:41 GMT
Viewed: 
455 times
  
In lugnet.cad.dev, Fredrik Glöckner writes:
"Don Heyse" <dheyse@hotmail.spam.go.away.com> writes:
I am also curious how ldraw mode generates the control points.
It is fairly well described here:

   http://folk.uio.no/fredrigl/technic/ldraw-mode/bezier-curve/

Basically, I push the control points back and forth until the length
of the curve is correct.  This is done by numerical integration, and
is rather CPU intensive.

I wish Frederic could whip up a short paragraph on how he uses
the length to position the control points.  I'm not bright enough
to digest an algorithm that big.  (I read the page on advanced
hose generation, but it didn't seem to be up to date with the rest
of the documentation).

Oh, you've already read it?  It's not true that it's not up to date.
Rather, I have added a simpler interface after writing the above
paragraphs, but the old method still works.

Ok, ok!  I admit it.  I am a moron.  I either read something else
that I got out of the google cache, or my eyes glazed over and I
lost focus before I got to the important parts.  Thanks for the
short version though.  Now I get it.

On second thoughts, the example Orion provided is sort of not that
relevant.  What he really wants in the example is not a curved
element, but rather a straight line between the two points.  So I
think that using this example as a bench mark may not be

I think that a totally different method may be needed in this case.

That's why I'm asking.  The small initial velocity method generates
a pretty nice (slightly curved) hose in this case.  This page:

  http://www.ma.usb.ve/~jacob/povgraph/bez.html

suggests a relationship between the bezier curve, a friction
coefficient, and an initial velocity.  It makes me think if we
came up with good defaults for friction and velocity for the
various hose materials we'd get curves that match the whe way
the real world parts behave.

The code Chris donated can optionally display where the interior
control points end up by drawing type 2 lines from the end points
to the subsequent interior points.  This gives a really nice
illustration of how the curve gets shaped, and the 2 extra lines
are easily deleted later.  It might be nice if this could be an
option at in ldraw mode.  Something like (setq
ldraw-bezier-draw-control-lines t).

It's an interesting idea, but I don't know how useful it is.  In all
the predefined hoses provided by LDraw-mode, the direction towards the
control points is uniquely defined by the element which you insert.

Yes, I understand the way the direction is calculated.  It's the
magnitude of the vector (velocity) in that direction that I'm
interested in showing with the lines.  In the example I posted
the magnitude is 50 LDU which gives a smooth curve.  If draw it
line by line in LEDIT you'll see the two blue lines don't get all
that close to the middle of the curve.  I suspect the control
points auto-generated by ldraw mode are very close to the center
of the curve, resulting in that unsightly zigzag.  If you could
see the magnitudes of the control point velocity vectors generated
by different lengths, it might be easier to understand the effect
of choosing different lengths.



Message has 1 Reply:
  Re: Problem with LDraw-Mode and LDDP Bezier Curve plugin
 
(...) I don't believe you! (...) Ok, fair enough. I've added the feature to add the "control lines". Put (setq ldraw-bezier-draw-control-lines t) in your .emacs file, and download the latest source from (URL) test it. Fredrik (22 years ago, 22-Oct-02, to lugnet.cad.dev)

Message is in Reply To:
  Re: Problem with LDraw-Mode and LDDP Bezier Curve plugin
 
(...) It is fairly well described here: (URL) I push the control points back and forth until the length of the curve is correct. This is done by numerical integration, and is rather CPU intensive. (...) Oh, you've already read it? It's not true that (...) (22 years ago, 21-Oct-02, to lugnet.cad.dev)

7 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR