Thread: 2D AND 3D Software problem
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.
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.
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.
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.
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.
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.
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.
A quick google finds this:
At 09:59 AM 12/30/2006, tony hakki wrote:
Can I use the following code for obtain STL file's all (x,y,z) surface coordinates?Thanks in advance
double X, Y, Z;
vtkSTLReader *read = vtkSTLReader::New();
Yes, if you first do a:
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.
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 04:13 PM.
By phill05 in forum Routers, Spindles & ControllersReplies: 7Last Post: 29-10-2013, 06:59 PM
By MTech in forum Computer SoftwareReplies: 2Last Post: 11-12-2012, 11:58 AM
By PWD in forum Routers, Spindles & ControllersReplies: 8Last Post: 25-11-2012, 09:29 AM
By gorbo in forum General DiscussionReplies: 17Last Post: 24-02-2011, 04:33 AM
By airwolf in forum Machine DiscussionReplies: 2Last Post: 10-11-2009, 07:08 AM