|
Welcome, Guest.
|
||||||
| VBA/COM Interop Step inside and get the VBA help you have been looking for. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: 2009-12
Posts: 4
![]() |
Hello!
This is my first time visiting this forum. I'm not sure that there are no solutions regarding my question... Please help me. I've got the problem with understanding, how AutoCAD calculates the coordinates of spline key points. Everything I need just to know formulas. I don't understand, how the t-parameter can be calculated for an arbitrary point on the spline. I'll be able to use them in my VBA project to examine my own algorithm of mesh building. And how can I get a data about my spline in the model space in VBA? Thanx for your attentiveness =) |
|
|
|
|
|
#2 |
|
Active Member
Join Date: 2007-06
Posts: 79
![]() ![]() ![]() ![]() ![]() ![]() |
I’m not sure I understand the full scope of your question.
The one thing I can say with a fairly high degree of certainty is that VBA (as apposed to all the other available APIs) has the most restricted access to AutoCAD’s core curve libraries. This is not to say, however, that a programmer with the appropriate background could not recreate the functionality with the curve properties (ControlPoints/FitPoints, -Tangents, Weights, etc.) VBA does have available. If, on the other hand, VB.NET (for instance) was the development language then a programmer would be able to tap into native AutoCAD libraries to further analyze curves for GetParameterAtPoint, GetFirst- and GetSecondDerivative, DistanceAtParameters or -Point, ClosestPointTo, etc. |
|
|
|
|
|
#3 |
|
Member
Join Date: 2009-12
Posts: 4
![]() |
Thank you, but I know that, and my question was about an algorithm of spline operation.
I use both VBA and VB.NET and would like to understand "the nature of AutoCAD splines". What are values of the t-parameter defined for each point? I suppose that the first point of a spline should have t=0, the end point - t=1, and the i-point should have t=i/(n-1), where i=0..(n-1) - an index of the point, n - the number of points I want a spline is based on. Is this true? |
|
|
|
|
|
#4 |
|
Active Member
Join Date: 2007-06
Posts: 79
![]() ![]() ![]() ![]() ![]() ![]() |
It is quite possible I’m still missing the critical point of the query, but:
AutoCAD can create both uniform and non-uniform (NURBS) splines. So, for instance, if a spline is created with the SPLINE command, the parametric range will be equal to the linear distance between all the selected Fit Points. If, on the other hand, the spline is created via the Pedit - Spline then Spline – Object, the parametric range will be uniform, equal to the number of vertex – Degree. This uniform version is similar to joined Bezier segments. Each of the four segment able to be evaluated over a unit range 0 to 1, 1 to 2, 2 to 3, 3 to 4. Run the LIST command on the two splines in the attached. Notice the differing parametric ranges for two, fairly similar, splines. |
|
|
|
|
|
#5 |
|
Member
Join Date: 2009-12
Posts: 4
![]() |
Oh! It's very helpfull, i've ever seen.
"The parametric range will be equal to the linear distance between all the selected Fit Points" - that's it! Thank you so much! Now I can see how my mesh drawing algorithm works in formulas =) I saw two points on your right drawing. They are not vertices needed to reconstruct a spline as I think. What are they for? Last edited by kaenlorn : 2009-12-28 at 03:55 AM. Reason: Additional quest. |
|
|
|
|
|
#6 |
|
Active Member
Join Date: 2007-06
Posts: 79
![]() ![]() ![]() ![]() ![]() ![]() |
Those are remnants of the Tangent vectors from the curve on the left.
With the drawing I uploaded to my previous post, try this: Command: splinedit Select spline: ***Select red spline created with Spline Command*** Enter an option [Fit data/Close/Move vertex/Refine/rEverse/Undo]: F Enter a fit data option [Add/Close/Delete/Move/Purge/Tangents/toLerance/eXit] <eXit>: P Enter an option [Close/Move vertex/Refine/rEverse/Undo/eXit] <eXit>: X Notice how that spline now only displays Control Points, and how those match the spline on the right. |
|
|
|
|
|
#7 |
|
Member
Join Date: 2009-12
Posts: 4
![]() |
Hmmm, it's the interesting toy =)
|
|
|
|
![]() |
|
||||||
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| what is Bezier | sherflor | 3ds Max - General | 2 | 2009-10-21 02:57 PM |
| Understanding Lookup | bcole.200021 | Dynamic Blocks - Technical | 2 | 2009-04-06 10:05 PM |
| Create Bezier Surfaces in AutoCAD 2006 | osw201 | AutoCAD 3D (2006 or below) | 3 | 2006-11-03 08:50 PM |
| not understanding sweeps | harkeychad | Revit Architecture - General | 0 | 2005-05-27 02:02 PM |