License Delivery maintenance is expected to occur on Saturday, November 30, between 8 AM and 11 AM CET. This may cause a short 3-hours outage in which license-related tasks: license key upload, download, update, SSA validation, access to the license pool and Graphisoft ID authentication may not function properly. We apologize for any inconvenience.
GDL
About building parametric objects with GDL.
SOLVED!

Possible to change the surface origin?

JGoode
Expert

Hello,

 

I am trying to create an object which is essentially just a block which uses A, B and ZZYZX to set the dimensions. Is it possible to be able to change the surface texture origin to something that isn't 0, 0? I have looked through the GDL reference guide as I thought I had seen it in there before but I can't seem to find it!

 

Any ideas?

 

Thanks

ArchiCAD 23

Windows 10
1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Yes.

VERT sets the co-ordinates and COOR does the wrapping.

 

Here is some code from my bath hop - only moves in x and y directions (not z, but that could be added in).

It is old so is only COOR and not COOR{3}.

I haven't looked into COOR{3{.

 

	prism_ 5, hob_height,
		0,0,15,
		0,b,15,
		a,b,15,
		a,0,15,
		0,0,-1!,

VERT 0+tile_fill_origin_x,0+tile_fill_origin_y,0 !Origin
VERT 1+tile_fill_origin_x,0+tile_fill_origin_y,0 !X direction
VERT 0+tile_fill_origin_x,1+tile_fill_origin_y,0 !Y direction
VERT 0+tile_fill_origin_x,0+tile_fill_origin_y,1 !Z direction
COOR 2+256,1,2,3,4
body -1

 

 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

View solution in original post

10 REPLIES 10
runxel
Legend

Proper texture wrapping is a topic on its own...

Have a look at "coor{3}".

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»

It looks like that is what I'm after, thank you! It is quite confusing so I'll have to try to wrap my head around it. 

ArchiCAD 23

Windows 10

If you have the Cookbook 3 by David Nicholson-Cole, there is a good example of VERT/COOR in there.

 

It is a bit difficult because not only do you need to wok out how the co-ordinates work, you also specify the VERT/COOR command after the element you want to affect - not before like with a MUL, ADD or ROT command.

 

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

Do you have to use both Vert and coor{3}? All I'm trying to achieve is to move the origin of the surface along, x, y and z, and for the texture to wrap as it usually would.

ArchiCAD 23

Windows 10
Solution

Yes.

VERT sets the co-ordinates and COOR does the wrapping.

 

Here is some code from my bath hop - only moves in x and y directions (not z, but that could be added in).

It is old so is only COOR and not COOR{3}.

I haven't looked into COOR{3{.

 

	prism_ 5, hob_height,
		0,0,15,
		0,b,15,
		a,b,15,
		a,0,15,
		0,0,-1!,

VERT 0+tile_fill_origin_x,0+tile_fill_origin_y,0 !Origin
VERT 1+tile_fill_origin_x,0+tile_fill_origin_y,0 !X direction
VERT 0+tile_fill_origin_x,1+tile_fill_origin_y,0 !Y direction
VERT 0+tile_fill_origin_x,0+tile_fill_origin_y,1 !Z direction
COOR 2+256,1,2,3,4
body -1

 

 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

That's perfect and makes it infinitely easier to understand than the reference guide. 

 

Many thanks for your help

ArchiCAD 23

Windows 10

No, If you use COOR{3} you don't need any VERTs. Thats because this command is self-sustained.

COOR{3} is basically  superset of vert and the old coor, since it now handles everything in the same command.

I think there is even a warning of some kind in the GDL reference manual displaying that COOR{3} superseeds all other methods and that VERT and COOR are deprecated. (Of course it still works, tho.)

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»

Thanks, as I mentioned I have not looked at COOR{3} so wasn't aware of that.

Looks like I need to start updating to COOR{3} then.

 

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

I always wonder if there is any impact in this.

GDL keeps all the old stuff viable, and breaking changes are rare. (well yeah, there was the purge of the possibility of param/master script for some commands, but otherwise?)

This kind of backwards compatibility is nice since you technically can still use  even 20 year old objects just fine. But still I'm wondering if this comes with a cost; like, do you have any benefit by updating your objects? You probably don't have to.

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»