Thread: 2D AND 3D Software problem
-
22-05-2009 #11
Yeah thats right. I need to use the 2D outlines of the buildings that are obviously on one flat plane, and have them cut out of freeform landscape a set depth. There is a software that does it but i cant define it well enough when searching.
-
22-05-2009 #12
I suspect this is either some proprietary software or a function in a very high-end CAD package. What have you been searching on?
Some of the terrain functions in GIS tools such as Geomantics GenesisIV might do the trick. But they are very expensive just for this purpose.
-
22-05-2009 #13
Thats what i figured. It seems to be pretty state of the art. I've just been brute force searching on google for "CNC software" and having alook at whats around, reading specs etc.
-
22-05-2009 #14
Does the 2D file have to be .hpg, can you output it in .stl or some other format?
Do you have a simple example of an .stl and .hpg files I can look at? i.e. not 100's of buildings, maybe a landscape with a couple of them?
I have an idea how this might be done, but I dont want to promise anything without being sure.
-
22-05-2009 #15
the buildings file is 2D just the plots not the complete building, therefore has no z-info. Yes you could adapt the file to extrude each building plot by a fixed amount, but what Ed needs is for each building plot to set the Z origin to the contour height at the centre of that plot and then adjust the Z cut to be a fixed depth from there into the surface. It could be done at the G-Code level but you'd need to emulate the landscape tool path and watch for the intersect with a building plot and then use that to adjust the g-code for the building plot (i.e. the pocket).
It would be better to do at the .stl level, not least because its easier to find the intersects and also because it could be reviewed/visualised before machining.
-
22-05-2009 #16
Yeah exactly. I've doing it the long way like you just described. It's the software i'm after more than anything. Will see if i can find a suitable file.
-
22-05-2009 #17
-
22-05-2009 #18
yes but its an .STL file, a surface made from triangles. Theres no simple way of deriving the height from the file without rendering it in a viewer, navigating to the relevant location and reading the height off the viewer then transfering that to the 2D plot. Which is what Ed has been doing roughly.
Thats why it needs to be done programatically - for each building plot find the triangles that intersect the plot, work out the height at the centre of the plot (not necessarily the vertex of a triangle), possibly average across more than one triangle (think what happens if the plot spans a deep crevice, where do you take the measurement from?) then offset negatively in the Z direction to turn the plot into a solid, so it can be pocketed. Better still, amend the STL file to create the pockets in-situ so it can all be machined in one go.
-
22-05-2009 #19
A quick google finds this:
At 09:59 AM 12/30/2006, tony hakki wrote:
hello;
Can I use the following code for obtain STL file's all (x,y,z) surface coordinates?Thanks in advance
tony
double X[3], Y[3], Z[3];
vtkSTLReader *read = vtkSTLReader::New();
Tony,
Yes, if you first do a:
read>Update();
http://www.vtk.org/
-
22-05-2009 #20
Bill,
Thanks for that. There are lots of STL tookits available, not all are freeware. I have one for C# as that is my preferred programming language (VTK is for C++). There is also an import for HPGL, but thats a plotter output not the solid model for the building plots so only gives lines not the polygons - another format would be better.
[edit]A little explanation as to why the problem isnt as straightforward as it may seem: STL files model the suface by using triangles, therefore there are 3 X,Y,Z tuples for each triangle. Knowing the X,Y of a point on the building plot doesnt help unless it happens to coincide exactly with a X,Y of a vertex on a triangle... and in the building plot data we only have the ends of the lines - 2 X,Y tuples. So the problem is one of how do we decide if a given line on a building plot intersects with a given triangle in the landscape.... [/edit]
Reading the STL and HPG files is easy, its calculating the intersections thats tricky - not technically hard to do, but when you have, as in Ed's case maybe 50000 triangles in the landscape and 100 or so building plot polygons that could be around 5 million intersects to be checked. A polygon to polygon intersect requires around 20 or so floating point calculations to get to the decision whether there is an intersect or not so we are looking at something like 100m calculations, maybe several minutes processing on a 'normal' PC, assuming it can all fit in memory at once (not a problem on a reasonable spec PC).
Still thats quicker than doing it by hand eh?Last edited by irving2008; 22-05-2009 at 05:13 PM.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Powertran VFD problem
By phill05 in forum Spindles & Drive MotorsReplies: 7Last Post: 29-10-2013, 07:59 PM -
Newbie. Questions about design software and machine control software
By MTech in forum Computer SoftwareReplies: 2Last Post: 11-12-2012, 12:58 PM -
VHD Mounting problem
By PWD in forum Spindles & Drive MotorsReplies: 8Last Post: 25-11-2012, 10:29 AM -
Problem with X
By gorbo in forum General DiscussionReplies: 17Last Post: 24-02-2011, 05:33 AM -
Z Problem
By airwolf in forum Machine DiscussionReplies: 2Last Post: 10-11-2009, 08:08 AM
Bookmarks