We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2023-02-27 12:54 PM
Hello,
I have a simple block using FOR – TO – NEXT to duplicate it, is there a way to add a random texture origin to each duplicated so there is no visible texture repetitions?
Juan.
Solved! Go to Solution.
2023-03-07 02:35 AM
Is it rotated? It is a bit hard to see in your image as your texture size is significantly bigger than your board size...
VERT 0 + tile_fill_origin_x[iDis], 0 + tile_fill_origin_y[iDis], 0 !Origin
VERT 1 + tile_fill_origin_x[iDis], 0 + tile_fill_origin_y[iDis], 0 !X
VERT 0 + tile_fill_origin_x[iDis], 1 + tile_fill_origin_y[iDis], 0 !Y
VERT 0 + tile_fill_origin_x[iDis], 0 + tile_fill_origin_y[iDis], 1 !Z
coor 2+1024, -1, -2, -3, -4
Ling.
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
2023-03-07 06:17 AM
Yes, in my case the texture doesn't "follow" the board size. But the texture is not rotated.
Could it be that I'm approaching this whole thing in the wrong way? 🤔
This is my surface:
3D script:
N1= CEIL(A /(RimaA+RimaV))
FOR H=1 TO N1
GOSUB 20
ADDx RimaV + RimaA
NEXT H
DEL TOP
END
20:
block RimaA, RimaB, B
RETURN
Juan
2023-03-07 07:00 AM - edited 2023-03-07 07:17 AM
Try this ...
Just use your surface material.
I have only offset in the 'y' direction.
And maybe turn the 'random origin' off in your surface material (mine is off).
board_width = 0.100
board_gap = 0.010
N1= CEIL(A /(board_width+board_gap))
FOR H=1 TO N1
GOSUB 20
ADDx board_width + board_gap
NEXT H
DEL TOP
END
20:
MATERIAL "Timber_Pine - vertical"
block board_width, B, ZZYZX
texture_origin_y = RND(10)
GOSUB 100
RETURN
100: !!texture mapping
VERT 0,0+texture_origin_y,0 !Origin
VERT 1,0+texture_origin_y,0 !X direction
VERT 0,1+texture_origin_y,0 !Y direction
VERT 0,0+texture_origin_y,1 !Z direction
COOR 2+256,1,2,3,4
body -1
RETURN
Barry.
2023-03-07 07:16 AM
Mind you, if you texture is big enough you may not even need the VERT/COOR gosub.
You can see here the repetition without VERT/COOR - not great but it is OK.
If you are using the VERT/COOR gosub, you are really just using the first edge of the material.
I guess you could add in a 'texture_origin_x' offset as well which I took out of my example.
Your texture only needs to be one board width if you do use it, but a bigger texture is fine because you can use it for other situations as well as in sheeting rather than boards.
Barry.
2023-03-07 07:20 AM
Thank you, now I started understanding the logic (somehow 😅) . Some things are more difficult than expected,
Juan
2023-03-07 07:50 AM
In my case I'm using a texture that is meant for wood panels more than borads, so having an offset in x and in z it helped a lot to avoid any tiling in any direction.
The reason for all this is that those boards are going to be used as inner ceilings in open spaces that can cover up to 15m by 15m, and if you count that each board is 5cm wide, you can image how does it looks if there is no texture offset.
Juan
2023-03-07 07:54 AM - edited 2023-03-13 08:33 AM
Hi Peter,
Can the seed range be used to randomise a material?
MATERIAL mat_array[int(rnd(SYMB_POS_X % mat_count)) + 1]
I was hoping to use it within a loop to randomly use between 1 and 5 random materials, but the RND does not change within the loop, only when the object is placed again...
Ling.
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
2023-03-14 09:02 AM
COOR{3} expects that the texture axis coordinates are expressed in the space before moving the origin (unlike XFORM).
It is much simpler to let GDL do the transformations, and use the current coordinate system with COOR{3}:
add dx, dy, dz
rotz da
coor{3} 2, 4,
0,0,0,
1,0,0,
0,1,0,
0,0,1
del 2
body -1
Don't forget body -1 when modeling objects in a loop.
2023-03-16 11:33 AM
Sorry, my mistake, I oversimpified the example. What worked for me is:
Here seed should be a fractional number greater than one to always utilize the whole range.
2023-03-17 02:31 AM
Hi Peter,
MATERIAL mat_array[int(rnd(abs(SYMB_POS_X) * mat_count) % mat_count) + 1]
Is giving me a static number per instance of the object.
Ling.
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |