CAD application theory

Everything else that doesn't fall into one of the other PB categories.
mrjiles
Enthusiast
Enthusiast
Posts: 238
Joined: Fri Aug 18, 2006 7:21 pm
Location: IL

CAD application theory

Post 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?
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6175
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: CAD application theory

Post 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 :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Re: CAD application theory

Post 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
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
Post Reply