We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

GDL
About building parametric objects with GDL.

Scale or Stretch Texture on the Surface

galiaf_velikiy
Booster

2023-03-12_14h24_13.jpg

Hi, guys. Could you please help me achieve the same scale effect as in SketchUp? The Unproportional Scale is also what I need. Thank you.


2023-03-12_14h24_13.jpg
6 REPLIES 6
Lingwisyer
Guru

I think you can just use the COOR commands?

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

2023-03-13_11h34_49.jpg

 I am already using COOR3.

 

bms_buildingMatAttribute_1 = 0
r = REQUEST{2} ("Building_Material_info", buildingMatAttribute_1, "gs_bmat_surface", bms_buildingMatAttribute_1)

mulx	A/           3
muly	B/           3
mulz	ZZYZX/           1
body    -1
model solid
resol       36


    pen     penAttribute_2
    set building_material buildingMatAttribute_1, DEFAULT, DEFAULT
    sect_attrs{2} penAttribute_3, lineTypeAttribute_1

vert{2}	           0,            0,            0, 1	!	#1   VertId=0
vert{2}	           0,            3,            0, 1	!	#2   VertId=0
vert{2}	           3,            0,            0, 1	!	#3   VertId=0
vert{2}	           3,            3,            0, 1	!	#4   VertId=0

pen penAttribute_2

edge	   1,    3,    1,    0, 262144			!	#1   EdgeId=0
edge	   4,    2,    1,    0, 262144			!	#2   EdgeId=0
edge	   2,    1,    1,    0, 262144			!	#3   EdgeId=0
edge	   3,    4,    1,    0, 262144			!	#4   EdgeId=0
vect	           0,            0,            1	!	#1  

material materialAttribute_1

pgon{3}       4,    1,    2,    6,    0, -3.000758471779, -2.992290207747,            0,            1,            0,            0,            0,            1,            0,            0,            0,            1,	!	#1   PolyId=0
		   1,		   4,		   2,		   3

material bms_buildingMatAttribute_1

coor{3}	   6,    8,
	           0,            0,            0,
	           1,            0,            0,
	           0,            1,            0,
	           0,            0,            1

body	262182

    material 0
    body    -1

 

 

COOR{3} can determine the origin of the surface, it direction and the method it is wrapped, but I am not 100% sure if it can stretch the surface.

 

Does it need to be done in GDL or can you just create a duplicate surface and increase the size of the texture?

 

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

it should be a GDL, I need it for the multiple-use case.

MetalFingerz
Advocate

@galiaf_velikiy ,

 

It's possible to scale a texture dynamically by having a DEFINE TEXTURE with scaling variables (and then doing a DEFINE MATERIAL with said texture) but I don't know if it's possible to extract the texture name from a REQUESTed material.

 

If you already know which texture you want, you could hardcode it directly maybe.

runxel
Legend

It's possible, even tho you must need to do some contortions.

 

file_name = ""
rrr = request{2}("Material_info", old, "gs_mat_texture", file_name, w, h, mask, alpha)

define texture "new" file_name, w*2, h*2, mask, alpha

tex_id = ind(TEXTURE, "new")

str_name_of_mat = ""
rrr = request("Name_of_Material", old, str_name_of_mat)

define material "new_mat" based_on str_name_of_mat,
	parameters gs_mat_texture_ind = tex_id

mat_id = ind(MATERIAL, "new_mat")


material old
brick 1,1,0.1

addx 1.3
material mat_id
brick 1,1,0.1

Don't get hurt.

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»