GDL
About building parametric objects with GDL.
SOLVED!

Is there any Morph element in GDL?

Partha02
Contributor

Hello there. I am searching for the Morph object creation in GDL. I have followed the GDL Reference Guide but there is no specific mention of the Morph object creation or related code. There is only mention of Morph in this section of the guide.


Is there any way to create a morph using GDL?


Thank you.

 

119adc05-7be2-4fdc-8c10-6ed600b8bc1c (1).png

1 ACCEPTED SOLUTION

Accepted Solutions
Solution
David Collins
Advocate

There is no MORPH element in GDL. Archicad creates morphs on the fly using primitive GDL elements VERT, VECT, EDGE, PGON & BODY. See GDL Reference guide page 137. This is why morphs are so parametrically dumb, compared to other GDL elements, but it’s pretty cool the way it works. The morph tool is actually Visual GDL deeply integrated into the program, the way Graphisoft used to do things.

 

Here’s what a simple morph 1.00 x 1.00 x 1.00 cube looks like in GDL:

 

 

!!MORPH-002 4D5A6FF6-D314-4C7D-AB62-DF96FA80A543

group "group_C0432EEC_C557_4238_B568_399000C76D26"
    pen     3
    set building_material " 1e Schematic blue", DEFAULT, DEFAULT
    sect_attrs{2} 7, ind(LINE_TYPE,"Solid")
vert{2}                    0,            0,            0, 1  !         #1   VertId=0
vert{2}                    0,            0,            1, 1  !         #2   VertId=0
vert{2}                    0,            1,            0, 1  !         #3   VertId=0
vert{2}                    0,            1,            1, 1  !         #4   VertId=0
vert{2}                    1,            0,            0, 1  !         #5   VertId=0
vert{2}                    1,            0,            1, 1  !         #6   VertId=0
vert{2}                    1,            1,            0, 1  !         #7   VertId=0
vert{2}                    1,            1,            1, 1  !         #8   VertId=0
pen 3
edge      1,    3,    1,    2, 262144                    !         #1   EdgeId=0
edge      1,    2,    2,    5, 262144                    !         #2   EdgeId=0
edge      3,    4,    2,    3, 262144                    !         #3   EdgeId=0
edge      5,    1,    1,    5, 262144                    !         #4   EdgeId=0
edge      2,    6,    5,    6, 262144                    !         #5   EdgeId=0
edge      3,    7,    1,    3, 262144                    !         #6   EdgeId=0
edge      7,    5,    1,    4, 262144                    !         #7   EdgeId=0
edge      5,    6,    4,    5, 262144                    !         #8   EdgeId=0
edge      4,    2,    2,    6, 262144                    !         #9   EdgeId=0
edge      6,    8,    4,    6, 262144                    !         #10  EdgeId=0
edge      7,    8,    3,    4, 262144                    !         #11  EdgeId=0
edge      8,    4,    3,    6, 262144                    !         #12  EdgeId=0
vect               0,            0,           -1      !         #1 
vect              -1,            0,            0      !         #2 
vect               0,            1,            0      !         #3 
vect               1,            0,            0      !         #4 
vect               0,           -1,            0      !         #5 
vect               0,            0,            1      !         #6 
material "  1d blue"
pgon     4,    1,      2,    1,       6,    7,      4           !         #1   PolyId=0
material "  1d blue"
pgon     4,    2,      2,    -1,      2,    -9,     -3           !         #2   PolyId=0
material "  1d blue"
pgon     4,    3,      2,    3,       -12,  -11,    -6           !         #3   PolyId=0
material "  1d blue"
pgon     4,    4,      2,    -7,      11,   -10,    -8           !         #4   PolyId=0

 

David Collins

Win10 64bit Intel i7 6700 3.40 Ghz, 32 Gb RAM, GeForce RTX 3070
AC 27.0 (4001 INT FULL)

View solution in original post

11 REPLIES 11
Lingwisyer
Guru

What are you trying to create? If you were looking for something constructed with splines, or nurbs, those are not possible. You can link AC with Grasshopper in Rhino though which can handle nurbs.

 

 

Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win10 | R5 2600 | 16GB | GTX1660
Solution
David Collins
Advocate

There is no MORPH element in GDL. Archicad creates morphs on the fly using primitive GDL elements VERT, VECT, EDGE, PGON & BODY. See GDL Reference guide page 137. This is why morphs are so parametrically dumb, compared to other GDL elements, but it’s pretty cool the way it works. The morph tool is actually Visual GDL deeply integrated into the program, the way Graphisoft used to do things.

 

Here’s what a simple morph 1.00 x 1.00 x 1.00 cube looks like in GDL:

 

 

!!MORPH-002 4D5A6FF6-D314-4C7D-AB62-DF96FA80A543

group "group_C0432EEC_C557_4238_B568_399000C76D26"
    pen     3
    set building_material " 1e Schematic blue", DEFAULT, DEFAULT
    sect_attrs{2} 7, ind(LINE_TYPE,"Solid")
vert{2}                    0,            0,            0, 1  !         #1   VertId=0
vert{2}                    0,            0,            1, 1  !         #2   VertId=0
vert{2}                    0,            1,            0, 1  !         #3   VertId=0
vert{2}                    0,            1,            1, 1  !         #4   VertId=0
vert{2}                    1,            0,            0, 1  !         #5   VertId=0
vert{2}                    1,            0,            1, 1  !         #6   VertId=0
vert{2}                    1,            1,            0, 1  !         #7   VertId=0
vert{2}                    1,            1,            1, 1  !         #8   VertId=0
pen 3
edge      1,    3,    1,    2, 262144                    !         #1   EdgeId=0
edge      1,    2,    2,    5, 262144                    !         #2   EdgeId=0
edge      3,    4,    2,    3, 262144                    !         #3   EdgeId=0
edge      5,    1,    1,    5, 262144                    !         #4   EdgeId=0
edge      2,    6,    5,    6, 262144                    !         #5   EdgeId=0
edge      3,    7,    1,    3, 262144                    !         #6   EdgeId=0
edge      7,    5,    1,    4, 262144                    !         #7   EdgeId=0
edge      5,    6,    4,    5, 262144                    !         #8   EdgeId=0
edge      4,    2,    2,    6, 262144                    !         #9   EdgeId=0
edge      6,    8,    4,    6, 262144                    !         #10  EdgeId=0
edge      7,    8,    3,    4, 262144                    !         #11  EdgeId=0
edge      8,    4,    3,    6, 262144                    !         #12  EdgeId=0
vect               0,            0,           -1      !         #1 
vect              -1,            0,            0      !         #2 
vect               0,            1,            0      !         #3 
vect               1,            0,            0      !         #4 
vect               0,           -1,            0      !         #5 
vect               0,            0,            1      !         #6 
material "  1d blue"
pgon     4,    1,      2,    1,       6,    7,      4           !         #1   PolyId=0
material "  1d blue"
pgon     4,    2,      2,    -1,      2,    -9,     -3           !         #2   PolyId=0
material "  1d blue"
pgon     4,    3,      2,    3,       -12,  -11,    -6           !         #3   PolyId=0
material "  1d blue"
pgon     4,    4,      2,    -7,      11,   -10,    -8           !         #4   PolyId=0

 

David Collins

Win10 64bit Intel i7 6700 3.40 Ghz, 32 Gb RAM, GeForce RTX 3070
AC 27.0 (4001 INT FULL)
runxel
Legend

There is no real equivalent to the Morph.

Well, you can use primitives. But doing that by hand and programmatically is probably like the holy grail.

I rather recommend using the different shapes GDL offers and putting together what you need.

(Would be also way easier if you would tell what exactly you're after)

 

Btw @Lingwisyer: You actually can script NURBS from GDL nowadays!... It's just like primitives on steroids and not really meant to be done by hand, I think. I mean, you could. If one would understand how its done 😅

Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
Barry Kelly
Moderator

A morph can be absolutely any size and shape so there would be next to no way to script it in GDL.

The closest is NURBS but that would not be easy as mentioned or creating it face by face with TEVE or VERT, EDGE VECT, PGON.

Almost impossible to script yourself.

 

And even if there was a MORPH command, it wouldn't become a morph, it will still be an object when you place it.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Lingwisyer
Guru

Ah, so when they added the Grasshopper connection they enabled actual NURBs. I had thought that is was just translating the nurbs to approximations. Now we just need the GDL editor to accept something like Mathjax!

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win10 | R5 2600 | 16GB | GTX1660

Hello. Can you please help me with this code?

VERT 0.0, 0.0, 0.0 !#1
VERT 1.0, 0.0, 0.0 !#2
VERT 1.0, 1.0, 0.0 !#3
VERT 0.0, 1.0, 0.0 !#4

VERT 0.0, 0.0, 1.0 !#5
VERT 1.0, 0.0, 1.0 !#6
VERT 1.0, 1.0, 1.0 !#7
VERT 0.0, 1.0, 1.0 !#8

EDGE 1, 2, 1, 3, 0 !#1
EDGE 2, 3, 1, 4, 0 !#2
EDGE 3, 4, 1, 5, 0 !#3
EDGE 4, 1, 1, 6, 0 !#4
EDGE 5, 6, 2, 3, 0 !#5
EDGE 6, 7, 2, 4, 0 !#6
EDGE 7, 8, 2, 5, 0 !#7
EDGE 8, 5, 2, 6, 0 !#8
EDGE 1, 5, 6, 3, 0 !#9
EDGE 2, 6, 3, 4, 0 !#10
EDGE 3, 7, 4, 5, 0 !#11
EDGE 4, 8, 5, 6, 0 !#12

VECT 1.0, 0.0, 0.0 !#1
VECT 0.0, 1.0, 0.0 !#2
VECT 0.0, 0.0, 1.0 !#3

PGON 4, -3, 0, -1, -4, -3, -2 !#1 !VERT1,2,3,4
PGON 4, 3, 0, 5, 6, 7, 8 !#2 !VERT5,6,7,8
PGON 4, -2, 0, 1, 10, -5, -9 !#3 !VERT1,2,5,6
PGON 4, 1, 0, 2, 11, -6, -10 !#4 !VERT2,3,6,7
PGON 4, 2, 0, 3, 12, -7, -11 !#5 !VERT3,4,7,8
PGON 4, -1, 0, 4, 9, -8, -12 !#6 !VERT1,4,5,8




1. From GDL ref guide, 
EDGE vert1, vert2, pgon1, pgon2, status.
In the above code, the polygons are defined after the edge. And also, how the polygons are defined in the EDGE section here?

2. From the GDL reference guide,
PGON n, vect, status, edge1, edge2, ..., edgen

In the guide, there is no mention of what happens if vect  is negative. Is it going to point out in the opposite direction if it's negative?


3. Here, 
VECT 1.0, 0.0, 0.0 !#1
VECT 0.0, 1.0, 0.0 !#2
VECT 0.0, 0.0, 1.0 !#3

is it always true for any 3D objects?


Thank you


  1. An EDGE can refer to a polygon defined later.
    In the case of a simplified definition (vect = 0 or status < 0 in a PGON) the primitives that are referred to by others must precede their reference.
    ...
    Searching for adjacent polygons by the edges is done during the execution of the BODY command.
    The numbering of VERTs, EDGEs, VECTs and PGONs is relative to the last (explicit or implicit) BASE statement.
  2. A negative index changes the direction of the stored normal vector or edge to the opposite in the polygon.
  3. Those are three unrelated vectors for the example cube. With their negative and positive references they represent the six differently-facing sides.
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest

I didn’t mean to give anyone the impression that I was a GDL guru. I generated that script for a morph cube by dragging a morph from the Archicad 3d window into the 3D script window of a new library object. The GDL script of any Archicad element can be displayed this way. This is always educational and can be a useful trick for creating new GDL library objects.

David Collins

Win10 64bit Intel i7 6700 3.40 Ghz, 32 Gb RAM, GeForce RTX 3070
AC 27.0 (4001 INT FULL)
yongler
Enthusiast

I used NURBS commands to create GDL components for curved surface。

can edit the shape of a surface by  pulling hotspots。

capture_20240224161223291.jpg   

capture_20240224161357219.jpg 

capture_20240224161607261.jpg