## The Ultimate Resource for TurboCAD Knowledge

Interested in some really terrific mobile apps? Visit www.turboapps.com for details.

Mathematical drawing & modeling
Read 6732 times
October 13, 2010, 01:20:03 PM
Ok, so I'm slowly getting into this CAD stuff. Mostly 2D to date.

Amongst a bunch of things, I'm into airplane design. Which brings me to my current brain twister.

I would like to draw an airplane fuselage, for which I have determined defining mathematical equations using excel.
In other words, I know that the fuselage cross sections are second degree equations, ( 1=(1-x/A)^.6+(1-y/B)^.6 ), where x=vertical distance from centerline, A & B being the fuselage width and height from the centerline, respectively.
I have determined other mathematical equations for both the top/bottom lines at the centerline, as well as the fuselage width. These are 6th order equations, where x= the longitudinal fuselage station and y being the calculated width or height at that point.

Can these be drawn directly in TC14.2 Pro using the equations to calculate the individual points, or do I have to create a spline curve using known ( excel calculated) points? My thinking is that I should be able to model the fuselage in 3D at the end of the day just using these equations. Can't find anything about this in my TC Ref. manuals or Kevi D's CadCourse documents.

Or does one have to upgrade to Catia or similar for this stuff?

Thanks for the help.

Matt

Logged
TC Pro 14.2 (Platinum Ed.) Build 57.9

October 13, 2010, 02:51:46 PM
If I understand your question correctly, a much simpler version of that same question might be, "Given the Cartesian equation of a sphere (and, presumably, its radius and the location of its center), can TurboCad use just the equation to draw that sphere?"

I think the answer is No. Even if TCad were to process the equation so as to draw a gazillion discrete points lying on the sphere, the result would be simply that: a gazillion points, not a Sphere. Pretty much useless, IMO.

But if we are willing to ask to program to draw a reasonable number of cross sections of that sphere, and then loft them to create a good approximation of a round ball, then it can be done. (Or create a single cross section and revolve it -- which works for a sphere but not for an aircraft fuselage; that's doable, too, and probably easier.) Sorry to say I don't know exactly how to do it, but I guess the procedure would involve working with the SDK.

Henry H

Logged

October 13, 2010, 03:52:28 PM
Although Henry's assessment agrees completely with my experiences, there are some ways around the problem. None of them seem to me to be anywhere near ideal, but you might try a few.

First, you can generate grid points in MS Excel and import those into TurboCad as a mesh. The TC manual has some information on 3D Meshes, and Winston's page at CadCourse.com has details of importing, for example, topological data.

Second, you can use DelftShip (a free 3D modelling program; Google 'DelftShip') to get tables of data points into 3D grids, and then do a fair amount of manipulation on that grid. When you have what you want there, you can export the 3D grids to .dxf, and then read those into TurboCad.

Third, if you have access to a Math program, like MAPLE, you can put in your equations and have the program generate 3D plots. Those can be exported, by way of .dxf, for example, into
TurboCad.

All of these approaches can give good TC 'surfaces', but I have never been able to get ACIS solids by use of any of them.

I think there are some SDK apps that can generate points, or splines, from equations, but I don't know where to find them.

Don Ritchie

Logged
TC 11.2 and 17.2 Platinum

October 13, 2010, 04:21:02 PM
Just scanned the SDK stuff at the end of the manual. Its "basic" (pun!) stuff. Just VBS, with what, at least at first glance, looks like some nice API's that among other things can create polylines (of course, sometimes things don't work quite as well when you try them). So maybe you  could create a script to do do your calculations and then make a series of polylines, and then prism or loft them together to form  a fuselage (probably by hand, but how knows?) Seems like a cakewalk for anyone ready to handle 6th degree polynomials

Is this for a model fuselage, or a real one?  Even with Catia, you might find yourself working in VB.

Somehow I had the impression that the SDK came with deluxe, but apparently was mistaken. Though an advanced feature, its so advanced that it doesn't seem like it would hurt sales to include it at a lower level (beginners wouldn't know what to do with it), and might enhance the value of the product as people familiar with programming could contribute scripts to the community.

SU seems to be taking this approach, including a Ruby scripting API even with their low-end product (but they save parametric parts programming for the advanced version).

Mark

Logged
TCW Pro 14.2
TC Deluxe 16.2 Build 53.2

October 13, 2010, 05:27:31 PM
My approach for the fusalage would be to plot the points where your formers are going to be and then draw the formers using the points. You then may be able to loft between the formers, although lofting for me is a hit or miss operation.

I have no problem lofting  between a front and rear profile of a turtledeck with a 1/4" sq. center spar, then taking cross sections of the loft for addition formers. Works great. I have not had much luck trying to loft a  tapered symmetrical wing using a root rib and tip rib with a couple of spar notches. It twists into strange shapes.

If your brain starts to cramp up from all the math try using a bit of TLAR. (that looks about right)

Logged

October 13, 2010, 06:36:14 PM
Ok guys. Thanks for the replies. Although I don't quite follow all of your acronyms.

First, this is for a full size airplane, not a model.

I follow Henry's answer, but think that some of it is a bit 'tongue-in-cheek'. I'm not looking to do a gazillion discrete points. I just want to define those for the fuselage former locations, then loft the shape accordingly.
In principle, I can define the basic fuselage shape with 4 seperate mathematical equations (former shape based on the width and height above/below centerline, the upper fuselage profile, lower fuselage profile and the width). So for every location 'x' along the centerline from nose to tail, I can calculate the upper, lower profiles and the width. From those, you get the former shape. Then generate a loft / Bezier curve to fit these points.
Seems simple enough.

MarkS- what do you refer to with "SU" and "API". Must admit, I'm pretty new at this CAD stuff, even though I've been drawing with pen/paper for longer than I care to acknowledge. I don't have the SDK for my version, or at least, am not aware of it (have v14 Pro Platinum Edition, with the 14.2 patch). The polynomial equation is readily obtained through the excel plot routine. This makes it easy to do the loft / straighten the points. I'm not that much of a math whiz. However, I find it easier to determine a mathematical model which applies to all areas than using the TLAR approach in (hopefully) getting a good spline fit. The shape has to go through certain points, while others can be smoothed.  Maybe I'll have to try another tack and work directly in TC using the width / height data. Would be easier to "read-in" half a-gazillion points though.

Don- will check out the CadCourse pages and start looking for MAPLE. Maybe that will help. I have a copy of Freeship!, which is a DelftShip relative. I've been drawing / designing boats with it for a while now. I just find exporting the data to TC to be a pain and am not able to accurately draw the resulting shape in TC with sufficient accuracy. Probably a learning curve (or lack of it) thing.

extra230- I need to get quite a bit closer than TLAR, I'm afraid.

Is there an application available (3rd party etc.) that would read in excel data (i.e.- in batch form) for the x,y and/or x,y,z points? If so, one should be able to loft from those, no?

Thanks again,

Matt

Logged
TC Pro 14.2 (Platinum Ed.) Build 57.9

October 13, 2010, 06:58:34 PM
Ok guys. Thanks for the replies. Although I don't quite follow all of your acronyms.

First, this is for a full size airplane, not a model.

MarkS- what do you refer to with "SU" and "API". Must admit, I'm pretty new at this CAD stuff, even though I've been drawing with pen/paper for longer than I care to acknowledge. I don't have the SDK for my version, or at least, am not aware of it (have v14 Pro Platinum Edition, with the 14.2 patch). The polynomial equation is readily obtained through the excel plot routine. This makes it easy to do the loft / straighten the points. I'm not that much of a math whiz. However, I find it easier to determine a mathematical model which applies to all areas than using the TLAR approach in (hopefully) getting a good spline fit. The shape has to go through certain points, while others can be smoothed.  Maybe I'll have to try another tack and work directly in TC using the width / height data. Would be easier to "read-in" half a-gazillion points though.

A real fuselage? That's awesome.

SU means Google Sketch Up, a 3D drawing program who's output can be read by TC.

I don't know what the history of the SDK in TC is, so unless its something that's just appeared in the last couple of versions, you should have it in your Platinum setup. It only gets installed with a full installation, per the documentation. Did you do a full install?

Good luck,
Mark

Logged
TCW Pro 14.2
TC Deluxe 16.2 Build 53.2

October 13, 2010, 07:18:55 PM
I'll tout PolyCAD again for this.  PolyCAD can build curves or nurb surfaces from control point data and it's (pretty rudimentary) scripting interface, or, because it's got a "plain english" file format, with a little familiarity, you can tabulate the points, format them and identify the entity in a text file, then open the file in PolyCAD and, voila, your curves or surfaces are there to be exported into TC as IGES objects, identical to those you create building curves or lofts of curves in TC.  It's the most obvious, sensible, doable-even-for-dummies-like-me, almost-flatlined-learning-curve routine that I've been able to find in CAD.  If you've used Delftship or FreeShip, PolyCAD has some similarities like parametric hull generation, but it uses curves and nurb surfaces, not subdivision surfaces, so it relates better to TC, and the interface is more bare-bones - and to me, at least, more comprehensible.

Logged

October 13, 2010, 08:02:32 PM
Mark- I found some SDK stuff in my version under "AddOns", so I'd say I did the full install when I put it on my 'puter. That's what I normally do.
Can't see anything about VBS though...

Logged
TC Pro 14.2 (Platinum Ed.) Build 57.9

October 13, 2010, 09:12:23 PM

I follow Henry's answer, but think that some of it is a bit 'tongue-in-cheek'. I'm not looking to do a gazillion discrete points. I just want to define those for the fuselage former locations, then loft the shape accordingly.
In principle, I can define the basic fuselage shape with 4 seperate mathematical equations (former shape based on the width and height above/below centerline, the upper fuselage profile, lower fuselage profile and the width). So for every location 'x' along the centerline from nose to tail, I can calculate the upper, lower profiles and the width. From those, you get the former shape. Then generate a loft / Bezier curve to fit these points.
Seems simple enough.

Matt

OK. I kinda thought you were hoping to input the equations somehow, hit the "Draw My Airplane" button, and watch it happen ;-)

Henry H

Logged

October 14, 2010, 03:55:39 AM

OK. I kinda thought you were hoping to input the equations somehow, hit the "Draw My Airplane" button, and watch it happen ;-)

Henry H

Logged
AMD Phenom 1090T
8GB RAM
Radeon 5450 1GB
Windows 7
Redsdk  - Off
Editing History - On
v19.2 Platinum, x64

October 14, 2010, 04:40:52 AM
Matt:
It may be worth taking a look at
http://forums.turbocad.com/index.php/topic,4013.0.html

I have never used the SDK stuff, but have noticed that kchapman was/is working to make it useful.

Don Ritchie

Logged
TC 11.2 and 17.2 Platinum

October 14, 2010, 05:45:35 AM
Mark- I found some SDK stuff in my version under "AddOns", so I'd say I did the full install when I put it on my 'puter. That's what I normally do.
Can't see anything about VBS though...
Hi Matt,

It may be under parametric parts. Almost everything in the manual refers to creating parametric parts. So you really would create a component/part that might be labeled "Make my airplane".

Now that I've had a chance to peruse the text better, it seems like the SDK is a bit limited. You can't make 3D polylines directly, and you can't move the workplane.

I can visualize a technique with the current kit that might work. You'd create a polyline from your equations. Then extend it into a 3D object a specified step width. Then move the object the same distance along the working axis. Then create another polyline and extend it. Combine it additively with the prior object. Move both along the working axis. Repeat until finished.

Might be better to check out Murray's polycad suggestion

Mark

Logged
TCW Pro 14.2
TC Deluxe 16.2 Build 53.2

October 27, 2010, 11:42:56 PM
Quote
Now that I've had a chance to peruse the text better, it seems like the SDK is a bit limited. You can't make 3D polylines directly, and you can't move the workplane.

I am not sure I believe that.  It seems it would be pretty easy to build a VBS Script that create polylines using the AddPolys Method of the SDK Object model.

The syntax for the AddPolys Method is:

AddPolys(Type, Coords)

Where the type is the constant imsiPolyType and the Coords is a Variant Array of (X,Y,Z)

Therefore you would start at a particular Station (X) Then populate an Array for each (X,Y,Z) coordinate from your equations.  Only Y and Z would be changing based on your equations.  Then apply the addPoly(imsipolyType,yourArray)

Then loop to the next STA repeat with new values.

It could be done.  Then you would need to loft to get your surfaces.

That would be one way to skin this cat, I mean plane.

The SDK is pretty powerful,  I just find that it is lacking in it's  manual/help file.

I find programming the scripts is best done in a development environment like VB6.

« Last Edit: October 27, 2010, 11:45:02 PM by Johnny_Law »

Logged
TurboCAD v19 Platinum - 64bit
Windows 7 Ultimate - 64bit
Intel i7 - x980 (3.33 GHz 6 duo-core)
12GB RAM, ATI 5570 w/1GB VRAM, 2TB 7200rpm HDD

Fast but not the fastest...