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 / 5613
5612  |  5614
Subject: 
Re: bend thingie creator.
Newsgroups: 
lugnet.cad.dev
Date: 
Sun, 26 Nov 2000 15:33:04 GMT
Viewed: 
882 times
  
  It's very cool indeed, I've been trying to do something like this for
LeoCAD but I'm using Hermite curves and the user is able to move the
control points and direction vectors interactively.

I'm using a simplified form of bezier curves, like you see in most drawing
software like coreldraw etc..
this is also x = f(t), y = g(t) and z = h(t)  with f, g and h being a*t^3 +
b*t^2 +c*t + d . a, b , c and d can than simply be calculated with the given
coordinates. This is a correct third degree approximation but I'm hoping to
later go to 4th degree or higher approximations.

  Everything works reasonably well but I'm having trouble getting the
"up" vector for each section. I have 3 equations for the curve: x =
f(t), y = g(t) and z = h(t), I use the first derivative to get the
direction and the second derivative to get the normal vector and use it
as the up vector.

This was the problem with the release in my first posting (i think you mean
this), My rotation matrix based solely on the direction of the next segment
did provide with continous segments but it sometines turned 180° because it
switched to a different quadrant. I now have added another parameter with
which i can turn the segment around the direction. Now i Make the segment in
the correct direction , i calculate the distance between a point from the
previous segment and the current, turn it one degree to left and one to the
right, if the distance for one of these two turns is lower than the normal
distance i keep on turning that way until the distance is past its minimum.
than these two points are the closest together and my curve doesn't have any
strange twists.
It's kinda dumb and uses a lot of calculations but I like it to see my
computer calculate all this in less than a second :-) .

I've got many more ideas for extensions , like adding all the other kinds of
bendable things, making an easier interface, perhaps even using a few
comments and special parts directly in the drawing program of your choise
and then simply run btc and have everything created for you. And then I want
to also would want to add waypoints so you could direct an airtube through a
beamhole. But this is still a long way ahead off me because it's my first
program and the code is so messy that i'll have to rewrite it first before I
can make any chances :( .

  The problem is that in some cases the normal vector is 0 but I'm using
it and the direction vector to create a transformation matrix and
calculate the vertexes of each section.

  Would you comment on the method that you are using ?

No , moehahahahahaha. "evil grin" .

Leonardo



Message has 1 Reply:
  Re: bend thingie creator.
 
(...) I've thought about using bezier curves but I decided to choose another type of curve because it doesn't allow you to make the curve pass by a specific point (except the first and last points). (...) I'm using a different solution: I start with (...) (24 years ago, 26-Nov-00, to lugnet.cad.dev)

Message is in Reply To:
  Re: bend thingie creator.
 
(...) It's very cool indeed, I've been trying to do something like this for LeoCAD but I'm using Hermite curves and the user is able to move the control points and direction vectors interactively. Everything works reasonably well but I'm having (...) (24 years ago, 24-Nov-00, to lugnet.cad.dev)

14 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