Page 1 of 1

CAD application theory

Posted: Mon Mar 29, 2010 9:07 pm
by mrjiles
I'm "thinking about starting to think about" programming a small CAD/GIS viewer application. This would be used in lieu of Microstation/ArcGIS for the less technical users in my department. I know there are other viewers out there, but this would add video linking (when they click on a line, it would RunProgram to a video file).

At first I thought it would be easy by using the drawing library- read a list of line coordinates and draw them on an image. The only problem is that these lines are real world objects and span into the miles. OK, I can draw the objects at smaller scale. Problem solved.

Now I am thinking about the zooming & panning functions. The user would need to be able to zoom in on the drawing. There will be thousands of lines, so obviously 1 zoom level would not be efficient. I cannot wrap my head around zooming. I realize I can increase the scale of the image, but at some point the image will occupy more memory than the computer has available.

The method I have "thought up" so far is to search to search the list of coordinates to check if the line will fit on screen. Here's the steps it would encompass:

1. Set zoom window (square/rectangle coordinates): min x 500, max x 1000, min y 500, max y 500. This zoom window would also dictate the zoom level.
2. Scan my list of coordinates and identify all lines that will fit
3. Draw lines on screen at scale

Am I thinking about this correctly? Can anybody share some insight?

Re: CAD application theory

Posted: Mon Mar 29, 2010 10:40 pm
by blueznl
Ages ago I've done stuff in this direction, wrote a 'nesting' program for organizing cutout elements for large plasma cutting machines.

All elements of a drawing are in memory. Then you need to figure out what elements to display and what not. What you need to do is figure out which elements are possibly on screen, and which ones are certainly not. So you're right there :-)

Now, if those lines are overlaying on an image, then each point of the image matches a certain coordinate. You can zoom in on the image, magnifying part of it, and you do not have to resize the full image, only the part you want to zoom in on.

Hmm. Sounds easy :-) So it cannot be easy :-)

Re: CAD application theory

Posted: Mon Mar 29, 2010 11:17 pm
by Rook Zimbabwe
I looked in to this a while ago for a method to create OGRE primatives when I lost my RHINO3d and UU3d keys (My HDD died!)

There were a couple of CAD DLL files out there... Looked like they would solve most of the problems you addressed including reading several vector and cad formats!

This one would require COMmate maybe
http://3d2f.com/programs/10-022-vecad-d ... load.shtml


http://www.topshareware.com/cad-dll/downloads/1.htm
http://www.fyxm.net/CAD-Importer-63181.html