Developer forum
cancel
Showing results for
Did you mean:

## Dynamic Polyline base code object - VERSION 2

Participant
Hello everyone.

Almost seven years now from the polyline object. Wow. I've seen some awesome objects created with that. Congratulations to all of you who have taken a plunge into understanding GDL and that old object, and used it to create amazing things and shared them with the rest of us.

I've had these "version 2" objects for years now. Made them, thought of things to do with them, got busy living and working, used them in a couple of objects for me, and forgot about them.

I tried to simplify the main polyline functions as much as I could, so building upon them was easier. Still couldn't solve the "z" coordinate issue when removing points but it really is no big deal (i think).

The main goal at the time was to add arcs, but to be done over the simplified script. So... the library has a few objects:
* Two objects with the main functions. The difference with these is the way the script is written. One has separate x, y and z arrays, the other one has only one XYZ array. Would depend on your liking to use either one.
* A version 2 Dynamic Polyline, that includes arcs. This was a challenge and a nightmare. Dealing with the way GDL creates arcs is really something, and then realizing there would be ellipses, projected and rotated spherical and polar coordinates involved, was frightening. I just couldn't figure out some other arc examples on how they were done with simpler code. Mine was the result of extensive trigonometry research of long forgotten things. Has two type of arcs: based on floor plan projection (which yields helices in 3D) or based on the segment's 3D rotation (which yields ellipses in floor plan). It was not easy, but quite satisfying to achieve.
* A dynamic multi-polyline object. This one doesn't have arcs (my brain would have died), but has the ability to have many polylines in a single object. It is not using MACRO calls to load the basic functions. I saw this way of using the polyline object to have and use more than one poyline, and wanted to see if I could solve it within the same object. Perhaps you might find good use for this one, despite missing arc code.

I really hope you find these useful, either to build and share more objects, or just to learn a few things that might help you. They are shared using this license.

Thank you everyone.

Enjoy!
28 REPLIES 28
Expert
Super fun stuff. Cant wait to see what you did!
AC 24, Twinmotion current, Windows 11, Msi 10UG with rtx 3070, wacom intuos pro m, Wacom Cintiq Pro 16, razer Tartarus pro.
Booster
Thank you for sharing!

Just one question, one of your objects is protected by password, is it volontary?

(It is the Dynamic Polyline ER LK Report Length)
Participant
Mathias wrote:
Thank you for sharing!

Just one question, one of your objects is protected by password, is it volontary?

(It is the Dynamic Polyline ER LK Report Length)
Hi.
I remember I shared the locked object for length measuring purposes only. It is basically the polyline object but with two added length parameters: list2DLength and list3DLength; with some code in master script after this section
!---LENGTH-----
!_______________
```!---LISTING LENGTH---	20170323-01-Added listing parameters
PARAMETERS list2DLength = fullLength[1][get2D]
PARAMETERS list3DLength = fullLength[1][get3D]
LOCK "list2DLength"
LOCK "list3DLength"
!_______________________________________________________________```
That's it.
Best regards.
Anonymous
Not applicable
Thank you so much.

You are my idol
@sinceV6

Thanks a lot for sharing the scripts with us ... anyhow, I couldn't revise them in detail until now, so I will put my questions and comments whenever I fond something that I find interesting.
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.
Tip 01: Optimisation
The midpoint coordinate component that you used:
Midpoint = Pt01 + ((Pt02 - pt01) / 2)

Its optimised version is:
Midpoint = (Pt01 + Pt02) * 0.5
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.
Expert
I want to point you at my last polyline-Object on the foundation of sinceV6:

It "curves" between all edges with bezier-curves - also in the Z-Axes (and now graphisoft should make an export for mario-cart! )

had no time to make an Engish-Version, but you should get the points.

https://bimcomponents.com/GSM/Details/24075

Profile-manager - profiles are used to follow the 3D-Polyline-Curve
AC5.5-AC25EduAut, PC-Win10, MacbookAirM1
Anonymous
Not applicable

Now THIS is mind boggling!
Simply amazing Hmooslechner.
Thanks for all your GDL contributions.
Just one question (And if the answer is yes, then this is a revolution): Is it possible to do rotation on the axis of the profile for individual nodes?
Expert
Thougt also about rotating at the nodes, but its not possible with the normal tube-command. Maybe Graphisoft could add an extension for the tube with the possibilities of rotating the profiles on nodes in the future?
AC5.5-AC25EduAut, PC-Win10, MacbookAirM1
Anonymous
Not applicable
I was afraid of that. You were almost creating the perfect road tool for Archicad.
Roads need rotation along the axis to compensate centrifuge forces.
Yes. The Tube command needs this upgrade urgently.
Moderator
Hmooslechner wrote:
Thougt also about rotating at the nodes, but its not possible with the normal tube-command. Maybe Graphisoft could add an extension for the tube with the possibilities of rotating the profiles on nodes in the future?
TUBE already has the ability to rotate the cross-section at each point on the path.

Here is a quick example...
```TUBE 4, 18, 16+32,
-2.0, 0.0, 0,
0.0, 0.0, 0,
0.0, 0.4, 0,
-2.0, 0.4, 0,

-1, 0, 0, 0,
0, 0, 0, 5,
4, 0, 0.1, 10,
6, 0, 0.15, 15,
6+4*sin(15), 4 - 4*cos(15), 0.2, 20,
6+4*sin(30), 4 - 4*cos(30), 0.25, 25,
6+4*sin(45), 4 - 4*cos(45), 0.3, 30,
6+4*sin(60), 4 - 4*cos(60), 0.35, 35,
6+4*sin(75), 4 - 4*cos(75), 0.4, 40,
10, 4, 0.45, 45,
6+4*sin(105), 4 - 4*cos(105), 0.5, 40,
6+4*sin(120), 4 - 4*cos(120), 0.55, 35,
6+4*sin(135), 4 - 4*cos(135), 0.6, 30,
6+4*sin(150), 4 - 4*cos(150), 0.65, 25,
6+4*sin(165), 4 - 4*cos(165), 0.7, 15,
6, 8, 0.75, 10,
0, 8, 1, 5,
-1, 8, 1, 0```

Barry.

One of the forum moderators.
Versions 6.5 to 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10
Expert
Now- its getting interesting. Didnt know/understand that and ignored it until now. - thanks. Lets look what we can make with it..... stay tuned.
AC5.5-AC25EduAut, PC-Win10, MacbookAirM1
Anonymous
Not applicable
Barry wrote:
TUBE already has the ability to rotate the cross-section at each point on the path.
Yes Barry. This is the thing! Perhaps this is a solution for Hmooslechner's object.
Hmooslechner wrote:
Now- its getting interesting. Didnt know/understand that and ignored it until now. - thanks. Lets look what we cam make with it..... stay tuned.
Thanks Hmooslechner... and may the force be with you.
Expert
I dont know how i could miss this possibilities till now, but it seems to be a kind of ignorance..

May the 4th be with me - hope it doesnt take that long..

After some tries - It seems pretty simple, but for me it is hours of work already.

Whats to do:

2 possibilities:

to apply profile - rotations on each edge extra with editable hotspots
or
rotate profiles on each edge at once with one command at all.

Make it on each edge is a bit easier, because you don't have to proof on wich side is the smaller angle and the user has to apply it on each edge extra in 3D (maybe in 2D-projected sections? similar to the length- sectioning)

A step aside: in Austria, streets are build nearly without rotating the profiles to keep the driven speeds down...
They are rotated just to keep the water floating away but not for getting higher curve-speeds.

Normally, streets are constructed with clothoid for road curves and my bezier-solution is some kind of "nearby miss" already. So this logic of the bezier-curves could also be taken for raising-falling of the profile-rotation on the Edges.
AC5.5-AC25EduAut, PC-Win10, MacbookAirM1
Graphisoft
The rotation of TUBE can become very hard to control when the path isn't close to planar.
This might not be a problem for a road, but be aware that's why you won't get the rotations exactly.
I wouldn't recommend it to make a tool that generates road sections for construction - only for visualisation.

We developed a macro called "gravity_tube" that allows easier control of the rotation by defining vectors that the rotations are relative to. An example is here: http://gdl.graphisoft.com/forums/topic/tube-twisting/#post-3848

For Grasshopper users there is a "Sweep" object on BIMComponents that allows extruding a profile along a space curve: https://helpcenter.graphisoft.com/knowledgebase/87306/ . It can be used without GH with a fixed number of four nodes, you can try it to get a feel of the geometry with the rotations. One important thing is that the sections at the nodes can be skewed, their x and y won't always be perpendicular.
Péter Baksa
Software Engineer, Library as a Platform
GRAPHISOFT SE, Budapest
Anonymous
Not applicable
Thanks Peter and Hmooslechner.

@ Peter Baksa
The node rotation reference plan is in the bisector of the angle defined by two segments axis, right?
I can see that the geometry gets much distortions with rotations. Does the "Gravity Tube" totally eliminates them?

I see the profile node rotation as a must, as in many practical situations, roads always have this characteristic. But perhaps someone here on the forum with solid background in civil engineer could give some feedback.
Graphisoft
Braza wrote:
The node rotation reference plane is in the bisector of the angle defined by two segments axis, right?
I can see that the geometry gets much distortions with rotations. Does the "Gravity Tube" totally eliminates them?
Yes, the tricky part is the direction of the 0° direction on that plane. It is the projection of the Z axis to the plane, but sometimes is flipped 180° so the tube is less twisted. Sometimes this flipping is not needed for the model, but it can't be controlled intuitively.
gravity_tube solves this issue by letting you define the axis that is projected onto the plane, and never doing the extra flip.

The distortion of the TUBE remains the same if it is very twisted. That is because the faces between the nodes are planar, keeping a low polygon count.
Péter Baksa
Software Engineer, Library as a Platform
GRAPHISOFT SE, Budapest
Expert
a little look in the recent tries to get it working:

Its defenitly possible, but there is some cosmetic work to do..

There is another problem with streets: in curved sections, they usually are broader than in straigt directions - sections. Here the tube-command comes to its "boarders". The trailing-curve comes into the topic.
AC5.5-AC25EduAut, PC-Win10, MacbookAirM1
Mentor
Btw, there is an undocumented Registry Key under
`HKEY_CURRENT_USER\Software\GRAPHISOFT\ARCHICAD\ARCHICAD <version>\GSModeler\Better GDL Tube Triangulation`
Maybe Peter can shed some light onto this one 🙂
AC 24 [ger] | Win 10 | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»

Latest solutions

Most liked posts