Modeling
About Archicad's design tools, element connections, modeling concepts, etc.

Getting contour lines from a mesh

Anonymous
Not applicable
I know how to apply 2d contour lines to a mesh such that the mesh takes on the 3-d characteristics of my 2-d survey; I'm wondering if there's a way to go the other way.

That is if I start with a mesh and manipulate the mesh by elevating nodes, just generally shifting parts of the mesh around can I then have it tell me what the contour lines are? I am reminded of a tool, which I believe was called "contour", in Form-Z which I always used for making cnc templates out of irregular objects.

Basically, I'd like to be able to just grab points on a mesh, move them where ever the new architecture suggests they should be and then have ArchiCAD tell me what the contours would be.
26 REPLIES 26
rocorona
Booster
Just made in AC9 format, with a preview image, and posted it in the depository. Not sure of the category. I've put it in "General".

And finally tested... Found it is fast enough, also if the script is not so clever. It issues a "CALL" and a SEO operation for each contour line.
I think it can be done with only ONE call, using a series of planes as operator, but the planes needs to be large enough to cover the Mesh. Maybe this could be done using the RETURNED_PARAMETERS to know the A and B sizes of the mesh-object?.

Did a test of what happens if the original Mesh is updated... Simply selected it and re-saved as library object, overwriting the previous one. And the contour lines magically updates accordingly.
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________
Anonymous
Not applicable
Hello Roberto,
I downloaded your object and looked at the script
and found that you used the CUTPLANE command
to do the cutting of the object called in the script
rather than SEO (or the group operations equivalent)
as you stated. I changed the "contour line step"
parameter from 3'-3 3/8" to 1'-0" and got an error
saying "group operations error at line 21 of the 3D
script of...etc". I checked script but no errors are reported.
Looking at the script I can't see what the problem might be.

Why is calling the object more than once not desirable ?
I can see using a series of slabs separated by a very small
space and using group operations to leave very thin slices
of the object could be done but why ? The way you have done
it seem perfectly reasonable and economical.
Thanks,
Peter Devlin
rocorona
Booster
Peter wrote:
Hello Roberto,
I downloaded your object and looked at the script
and found that you used the CUTPLANE command
to do the cutting of the object called in the script
rather than SEO (or the group operations equivalent)
as you stated.
The SEO operation I was referring to is ISECTLINES. It is a special form of intersection, not present in ArchiCAD itself but only in GDL, that generate the intersection lines, without surfaces. I use it with the full mesh as the target and the cut mesh as the operator. This way I can do the whole thing without knowing the mesh size (the cutplane is infinite).
I changed the "contour line step"
parameter from 3'-3 3/8" to 1'-0" and got an error
saying "group operations error at line 21 of the 3D
script of...etc". I checked script but no errors are reported.
Looking at the script I can't see what the problem might be.
Sorry... it was metric.
I get the same error when I try to cut some other library element. It should work with any element, but I've tested it with a sofa and 3D people, to get some new representation... but with no luck. It worked with some of the basic shapes (cone, sphere).
Line 21 has the ISECTLINES command. It can have something to do with "no solid" operator (wireframe or simple surface).
Why is calling the object more than once not desirable ?
Only for the "waste" of time and computing resources! . I am an "old school" programmer (the generation that caused the millennium bug, just to save 2 bytes)
I can see using a series of slabs separated by a very small
space and using group operations to leave very thin slices
of the object could be done but why ?
As I said , this requires to know the size of the Mesh, in order to make the slabs big enough.
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________
Anonymous
Not applicable
WOW!!! y'all have been busy since I posted my question. David, not particularly automatic, but this will certainly come in handy from time to time.

Thanks everybody for your tips.
David Maudlin
Virtuoso
I added a page to my web site illustrating the method outlined near the beginning of this thread:

Extracting Contour Lines From a Mesh

David

900
David Maudlin / Architect
www.davidmaudlin.com
Digital Architecture
AC27 USA • iMac 27" 4.0GHz Quad-core i7 OSX11 | 24 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14
Anonymous
Not applicable
Roberto,
I really like this object - thanks alot.
rocorona
Booster
Mark wrote:
Roberto,
I really like this object - thanks alot.
Thanks for the appreciation. And it is so simple to make, that I'm surprised no one (including me) did it before
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________
Anonymous
Not applicable
your right it is relatively simple but very useful, im sure theres other features you could add to objects by this principal....
R Muller
Enthusiast
Thanks for the tips, guys.

I tried the library part, but no luck using it in AC13 (it hangs ArchiCAD on my Mac).

David, your cutting planes method worked, but I am clumsy using the cutting planes dialog box and I wanted something more automatic. I am working on a steep 10-acre site and need to draw 16 or more contour lines to evaluate various grading options.

I used a vertical stack of slabs to generate the contour lines, with SEO to automatically update them as the mesh changes. This generates all 16 contour lines in one step. It allows me to concentrate on the high points, valleys, and various spot elevations that I want to see on the site, and let the contours draw themselves.

Here are the instructions that I wrote for myself, so I can remember what I did the next time I need it. David, I have incorporated your technique for getting scaled lines out of a 3D view. I would never have come up with this all by myself.

1. Decide on your contour interval. For this discussion, I will assume a 2’ contour interval. Define the elevations of your lowest and highest contour lines. For this example, I will assume the lowest contour is 102’ and the highest is 124’.

2. On a separate layer, create a slab of the same thickness as the contour interval, with the bottom of the slab at the elevation of your lowest contour. For this example, this is a 2’ thick slab with top elevation 104’. Note that the top of this slab will generate a line for elevation 104’ and the bottom will generate a line for elevation 102’. Set the pen color and line type for the slab outlines to match what you want for your contour lines. The slab should completely cover your mesh, but it does not need to be trimmed to the mesh shape.

3. Multiply the slab to create slabs at elevation 108’, 112’, 116’, etc. You want to have a gap of one contour interval between each successive slab. Each slab will generate two contour lines: one for its top surface, and one for the bottom surface. Group the vertical array of slabs.

4. Use solid element operations to intersect the slabs with the mesh. The slabs are the target, the mesh is the operator.

5. Set 3D window settings to internal engine, hidden line. Set 3D projection settings to parallel, top view.

6. Select the group of slabs (but not the mesh), right click, show selection in 3D. You will see your contours. (See note below if you do not see any contours.)

7. Save this 3D view, with a name such as “generate mesh contours”.

8. Using the marquee tool (flat geometry method) in the 3D window, select the contours. Copy. In the copy dialog box, choose “Scaled Drawing”, “Edges”, “Remove Redundant Lines”.

9. Go to your 2D view, set the layer setting to your site plan. Paste. The contour lines will come in on the ArchiCAD layer at the original mesh/ slab location, which should be where you want them to be. In some cases they will come in behind other elements, and you won’t see them yet.

10. Undo/ redo the Paste to select all the contour lines, bring to the front if necessary, and assign to your chosen layer. You may wish to group the lines.

11. If you change your mesh, all you need to do is click on your “generate mesh contours” view to regenerate the new contours. Then erase the current contours and repeat steps 8-10 to revise the contours in the plan.

Note: if you do not see any contours in step 6, it may be because your slabs are touching, rather than gap-toothed. You want to omit alternate slabs, as noted in step 3. ArchiCAD removes the intersection lines in 3D view between two slabs where the top of one is the same as the bottom of the next.

Leave the group of slabs in your model, as a way of automatically revising your contours if you change your mesh.
R Muller
AC 26 USA (20+ years on ArchiCAD)
MBP 64GB Apple M1 Max OS 12.1 Monterey
Nader Belal
Mentor
Hi everyone,

I'm fully aware that this topic is old, and could be considered even solved, but I just have seen it now, and I think I can contribute solving this issue.


This solution is easy to implement, and it's done in a step by step manner, but it requires the use of Grasshopper.

You can check at here

Anyway, I hope that with it you will get the result that you hoped for.
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.