GDL
About building parametric objects with GDL.
SOLVED!

Material // Fill Direction in section/elevation

Anonymous
Not applicable
I've programmed a Door for a shower wall and the Material Fill is mirrored if the Door is mirrored.
It looks very jarring compared to the Glas wall next to it.

Is it somehow possible to define the direction of the fill based on the Global direction as supposed to the orientation of the Object?
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Barry Kelly
Moderator
Arnaut2604 wrote:
I've programmed a Door for a shower wall and the Material Fill is mirrored if the Door is mirrored.
It looks very jarring compared to the Glas wall next to it.

Is it somehow possible to define the direction of the fill based on the Global direction as supposed to the orientation of the Object?

Look into the use of VERT and COOR to redefine the material orientation.
You will need to trap it if the object is mirrored.

So something like ...
body -1
MATERIAL ....
PRISM_ .... (or what ever it is you use to model the door panel)

if SYMB_MIRRORED = 1 then
    VERT 0,0,0 !Origin
    VERT -1,0,0 !X direction
    VERT 0,1,0 !Y direction
    VERT 0,0,1 !Z direction
    COOR 2+256,1,2,3,4
    body -1
endif

I think the '-1' for the X direction will mirror the material.
I am not able to check it at the moment, but I am pretty sure it is something like that.


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

4 REPLIES 4
Lingwisyer
Guru
There is a GDL command that queries whether a door or window is mirrored or not. Using that return as a boolean, you could insert a section to change to texture orientation.

Page 578 in the GDL Reference Guide?



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
Barry Kelly
Moderator
Arnaut2604 wrote:
I've programmed a Door for a shower wall and the Material Fill is mirrored if the Door is mirrored.
It looks very jarring compared to the Glas wall next to it.

Is it somehow possible to define the direction of the fill based on the Global direction as supposed to the orientation of the Object?

Look into the use of VERT and COOR to redefine the material orientation.
You will need to trap it if the object is mirrored.

So something like ...
body -1
MATERIAL ....
PRISM_ .... (or what ever it is you use to model the door panel)

if SYMB_MIRRORED = 1 then
    VERT 0,0,0 !Origin
    VERT -1,0,0 !X direction
    VERT 0,1,0 !Y direction
    VERT 0,0,1 !Z direction
    COOR 2+256,1,2,3,4
    body -1
endif

I think the '-1' for the X direction will mirror the material.
I am not able to check it at the moment, but I am pretty sure it is something like that.


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
Anonymous
Not applicable
Perfect! Worked a charm!
Thanks so much!

I spent hours trying and couldn't get it to work
Barry Kelly
Moderator
Arnaut2604 wrote:
Perfect! Worked a charm!
Thanks so much!

I spent hours trying and couldn't get it to work

Awesome.

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