How to control texture angle on element created by EXTRUDE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-12-10 09:24 PM
But texture on top surface of the created element has wrong direction.
Even if I create texture on the runtime and assign angle by 0,
the material placed on the any other angle.
The code is:
angle = 0
define texture "owntile" "texture_wood.jpg",1,1,256, angle
define material "tilemat" 21,
0.7,0.7,1,
0.15,0.95,0,0.0,
0,0,
ind(fill,"fillAttribute_1"),1,
ind(texture,"owntile")
material tilemat
count = GoodwinGDLPointsCount
for i=1 to count
PUT GoodwinGDLPoints
next i
if count<>0 then
EXTRUDE count,0,0,0.04, 1+2+4+16+32,
GET(NSP)
endif
!points are placed on parameter array.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-12-15 08:24 AM
All you need to do is declare an angle parameter called "angle" and then use this code:
define texture "owntile" "texture_wood.jpg",1,1,256,angle define material "tilemat" 21, 0.7,0.7,1, 0.15,0.95,0,0.0, 0,0, ind(fill,"fillAttribute_1"),1, ind(texture,"owntile") material tilematThen insert the object, in 3D view click the object and set the angle parameter to any angle you want
In my test i had a crpism_ with tilemat as texture and the angle changed once I set it from 0 to 90
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-12-15 08:53 AM
I create figure by GDL command EXTRUDE in my object.
I need to control true texture angle without using any ARCHICAD menu command.
It's important. I'm need to set value to variable 'angle' with addons directly in 2d window to object.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-12-15 09:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-12-15 10:19 AM
When 'angle' is 0, direction of texture - unpredictably (red arrow).
I have to make the texture direction in 3d coincide with the direction of hatching in 2d (green arrow).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-12-15 11:35 AM
You measure how much phi is. The dirty and quick way to measure this is to add in several values for "angle" and see what angle value makes it line up with your red arrow.
This value is then your phi.
Then in your code that angle2 = angle - phi
and angle2 is your new angle variable that you call in your texture definition. That is the angle the texture will have to make sure that it lines up with the green line.
So based on your picture your code would roughly be:
angle2=angle-135 define texture "owntile" "texture_wood.jpg",1,1,256,angle2 define material "tilemat" 21, 0.7,0.7,1, 0.15,0.95,0,0.0, 0,0, ind(fill,"fillAttribute_1"),1, ind(texture,"owntile") material tilematNote:You can then still change the angle of the texture by changing the "angle"-value and it should line up with your green arrow. The 135 is just an educated guess for phi based on your drawing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-12-15 11:48 AM
But I do not know phi...
The texture placed how it want.
My figure is created dynamicly by coordinates writed to object by my addons from texture.
https://www.youtube.com/watch?v=Y3kn_M9Mtn4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-12-15 11:57 AM
So measure it once and it should work. The direction that the hatches are drawn will be guided by the "angle" parameter.
As long as your offset ("phi") is correct your texture should follow the hatch pattern.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-12-15 12:15 PM
For example for a laminate or a terrace board.
It is necessary to do without measuring the angles.
I noticed that the texture lies perpendicular to any side of the contour.
The angle could be obtained from the points of this side.
But how ARCHICAD chooses this side of the texture binding for EXTRUDE I do not know (.
In short, it is necessary that as in hatching in 2d:
set the angle from 0 and go texture there).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2017-12-15 12:25 PM
But the sides of the contour are stored in an array right?
So you can call those points and do some math.
You could calculate the longest side (sqrt((x2-x1)^2+(y2-y1)^2)
and then you can calculate the angle of that side with a horizontal line which will give you phi.
angleInDegrees = arctan(y2-y1 / x2-x1) * 180 / PI