<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to control texture angle on element created by EXTRUDE in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252272#M4624</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;I create element by command EXTRUDE&lt;BR /&gt;
But texture on top surface of the created element has wrong direction.&lt;BR /&gt;
&lt;BR /&gt;
Even if I create texture on the runtime and assign angle by 0,&lt;BR /&gt;
the material placed on the any other angle.&lt;BR /&gt;
The code is:&lt;BR /&gt;
&lt;BR /&gt;
angle = 0&lt;BR /&gt;
define texture "owntile" "texture_wood.jpg",1,1,256, angle&lt;BR /&gt;
&lt;BR /&gt;
define material "tilemat" 21,&lt;BR /&gt;
0.7,0.7,1,&lt;BR /&gt;
0.15,0.95,0,0.0,&lt;BR /&gt;
0,0,&lt;BR /&gt;
ind(fill,"fillAttribute_1"),1,&lt;BR /&gt;
ind(texture,"owntile")&lt;BR /&gt;
material tilemat&lt;BR /&gt;
&lt;BR /&gt;
count = GoodwinGDLPointsCount&lt;BR /&gt;
for i=1 to count&lt;BR /&gt;
  PUT GoodwinGDLPoints&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;[1]/1000,GoodwinGDLPoints&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;[2]/1000,GoodwinGDLPoints&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;[3]&lt;BR /&gt;
next i&lt;BR /&gt;
if count&amp;lt;&amp;gt;0 then&lt;BR /&gt;
EXTRUDE count,0,0,0.04, 1+2+4+16+32,&lt;BR /&gt;
    GET(NSP)&lt;BR /&gt;
endif&lt;BR /&gt;
 &lt;BR /&gt;
!points are placed on parameter array.&lt;/R&gt;&lt;/DIV&gt;</description>
    <pubDate>Sun, 10 Dec 2017 20:24:53 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-12-10T20:24:53Z</dc:date>
    <item>
      <title>How to control texture angle on element created by EXTRUDE</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252272#M4624</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;I create element by command EXTRUDE&lt;BR /&gt;
But texture on top surface of the created element has wrong direction.&lt;BR /&gt;
&lt;BR /&gt;
Even if I create texture on the runtime and assign angle by 0,&lt;BR /&gt;
the material placed on the any other angle.&lt;BR /&gt;
The code is:&lt;BR /&gt;
&lt;BR /&gt;
angle = 0&lt;BR /&gt;
define texture "owntile" "texture_wood.jpg",1,1,256, angle&lt;BR /&gt;
&lt;BR /&gt;
define material "tilemat" 21,&lt;BR /&gt;
0.7,0.7,1,&lt;BR /&gt;
0.15,0.95,0,0.0,&lt;BR /&gt;
0,0,&lt;BR /&gt;
ind(fill,"fillAttribute_1"),1,&lt;BR /&gt;
ind(texture,"owntile")&lt;BR /&gt;
material tilemat&lt;BR /&gt;
&lt;BR /&gt;
count = GoodwinGDLPointsCount&lt;BR /&gt;
for i=1 to count&lt;BR /&gt;
  PUT GoodwinGDLPoints&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;[1]/1000,GoodwinGDLPoints&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;[2]/1000,GoodwinGDLPoints&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;[3]&lt;BR /&gt;
next i&lt;BR /&gt;
if count&amp;lt;&amp;gt;0 then&lt;BR /&gt;
EXTRUDE count,0,0,0.04, 1+2+4+16+32,&lt;BR /&gt;
    GET(NSP)&lt;BR /&gt;
endif&lt;BR /&gt;
 &lt;BR /&gt;
!points are placed on parameter array.&lt;/R&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 10 Dec 2017 20:24:53 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252272#M4624</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-10T20:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to control texture angle on element created by EXTRU</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252273#M4625</link>
      <description>This seems to work for me.&lt;BR /&gt;
&lt;BR /&gt;
All you need to do is declare an angle parameter called "angle" and then use this code:&lt;BR /&gt;

&lt;PRE&gt;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 
&lt;/PRE&gt;

Then insert the object, in 3D view click the object and set the angle parameter to any angle you want&lt;BR /&gt;
&lt;BR /&gt;
In my test i had a crpism_ with tilemat as texture and the angle changed once I set it from 0 to 90</description>
      <pubDate>Fri, 15 Dec 2017 07:24:00 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252273#M4625</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-15T07:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to control texture angle on element created by EXTRU</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252274#M4626</link>
      <description>No.&lt;BR /&gt;
I create figure by GDL command EXTRUDE in my object.&lt;BR /&gt;
I need to control true texture angle without using any ARCHICAD menu command.&lt;BR /&gt;
&lt;BR /&gt;
It's important. I'm need to set value to variable 'angle' with addons directly in 2d window to object.</description>
      <pubDate>Fri, 15 Dec 2017 07:53:55 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252274#M4626</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-15T07:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to control texture angle on element created by EXTRU</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252275#M4627</link>
      <description>Not quite sure what you are trying to do.&lt;BR /&gt;
&lt;BR /&gt;
I added an example with an extrude and an angle parameter that can be set through UI or then through the parameter window (All paramaters v custom settings).&lt;BR /&gt;
&lt;BR /&gt;
Is that any help?</description>
      <pubDate>Fri, 15 Dec 2017 08:27:08 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252275#M4627</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-15T08:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to control texture angle on element created by EXTRU</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252276#M4628</link>
      <description>It example showes my trouble).&lt;BR /&gt;
When 'angle' is 0, direction of texture - unpredictably (red arrow).&lt;BR /&gt;
I have to make the texture direction in 3d coincide with the direction of hatching in 2d (green arrow).&lt;BR /&gt;&lt;IMG src="https://community.graphisoft.com/t5/image/serverpage/image-id/13298iFBD781D6501F40BA/image-size/large?v=v2&amp;amp;px=999" border="0" alt="needed_angle.jpg" title="needed_angle.jpg" /&gt;</description>
      <pubDate>Fri, 15 Dec 2017 09:19:41 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252276#M4628</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-15T09:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to control texture angle on element created by EXTRU</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252277#M4629</link>
      <description>But there is an angle between the 0 and the red line. Let's call it phi.&lt;BR /&gt;
&lt;BR /&gt;
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. &lt;BR /&gt;
This value is then your phi.&lt;BR /&gt;
&lt;BR /&gt;
Then in your code that angle2 = angle - phi&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
So based on your picture your code would roughly be:&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;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 tilemat &lt;/PRE&gt;

Note: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&lt;BR /&gt;&lt;IMG src="http://community.graphisoft.com/t5/image/serverpage/image-id/68270i06C86E426A12FD7D/image-size/large?v=v2&amp;amp;px=999" border="0" alt="phi.png" title="phi.png" /&gt;</description>
      <pubDate>Fri, 15 Dec 2017 10:35:22 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252277#M4629</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-15T10:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to control texture angle on element created by EXTRU</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252278#M4630</link>
      <description>No(.&lt;BR /&gt;
But I do not know phi...&lt;BR /&gt;
The texture placed how it want.&lt;BR /&gt;
&lt;BR /&gt;
My figure is created dynamicly by coordinates writed to object by my addons from texture.&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="https://www.youtube.com/watch?v=Y3kn_M9Mtn4" target="_blank"&gt;https://www.youtube.com/watch?v=Y3kn_M9Mtn4&lt;/A&gt;</description>
      <pubDate>Fri, 15 Dec 2017 10:48:53 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252278#M4630</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-15T10:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to control texture angle on element created by EXTRU</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252279#M4631</link>
      <description>phi will be static. The offset between the angle and the green line will be constant.&lt;BR /&gt;
&lt;BR /&gt;
So measure it once and it should work. The direction that the hatches are drawn will be guided by the "angle" parameter.&lt;BR /&gt;
&lt;BR /&gt;
As long as your offset ("phi") is correct your texture should follow the hatch pattern.</description>
      <pubDate>Fri, 15 Dec 2017 10:57:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252279#M4631</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-15T10:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to control texture angle on element created by EXTRU</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252280#M4632</link>
      <description>The problem is that I need to create a template for the BIM area objects.&lt;BR /&gt;
For example for a laminate or a terrace board.&lt;BR /&gt;
It is necessary to do without measuring the angles.&lt;BR /&gt;
&lt;BR /&gt;
I noticed that the texture lies perpendicular to any side of the contour.&lt;BR /&gt;
The angle could be obtained from the points of this side.&lt;BR /&gt;
But how ARCHICAD chooses this side of the texture binding for EXTRUDE I do not know (.&lt;BR /&gt;
&lt;BR /&gt;
In short, it is necessary that as in hatching in 2d:&lt;BR /&gt;
set the angle from 0 and go texture there).</description>
      <pubDate>Fri, 15 Dec 2017 11:15:14 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252280#M4632</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-15T11:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to control texture angle on element created by EXTRU</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252281#M4633</link>
      <description>My guess would be that the texture would be perpendicular to the longest side of the extrude.&lt;BR /&gt;
&lt;BR /&gt;
But the sides of the contour are stored in an array right?&lt;BR /&gt;
&lt;BR /&gt;
So you can call those points and do some math.&lt;BR /&gt;
&lt;BR /&gt;
You could calculate the longest side (sqrt((x2-x1)^2+(y2-y1)^2)&lt;BR /&gt;
&lt;BR /&gt;
and then you can calculate the angle of that side with a horizontal line which will give you phi.&lt;BR /&gt;
&lt;BR /&gt;
angleInDegrees = arctan(y2-y1 / x2-x1) * 180 / PI</description>
      <pubDate>Fri, 15 Dec 2017 11:25:49 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252281#M4633</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-15T11:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to control texture angle on element created by EXTRU</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252282#M4634</link>
      <description>Look for COOR (COOR{3}) command</description>
      <pubDate>Fri, 15 Dec 2017 11:28:39 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252282#M4634</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2017-12-15T11:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to control texture angle on element created by EXTRU</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252283#M4635</link>
      <description>Ye-e-s-s-s-s!)))&lt;BR /&gt;
Really the COOR command!&lt;BR /&gt;
&lt;BR /&gt;
!This code works:&lt;BR /&gt;
&lt;BR /&gt;
define texture "owntile" "texture_wood.jpg",1,1,256,GoodwinGDLAngle&lt;BR /&gt;
define material "tilemat" 21,&lt;BR /&gt;
0.7,0.7,1,&lt;BR /&gt;
0.15,0.95,0,0.0,&lt;BR /&gt;
0,0,&lt;BR /&gt;
fillAttribute_1,1,&lt;BR /&gt;
ind(texture,"owntile")&lt;BR /&gt;
&lt;BR /&gt;
material tilemat&lt;BR /&gt;
&lt;BR /&gt;
count = GoodwinGDLPointsCount&lt;BR /&gt;
for i=1 to count&lt;BR /&gt;
  PUT GoodwinGDLPoints&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;[1]/1000,GoodwinGDLPoints&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;[2]/1000,GoodwinGDLPoints&lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;[3]&lt;BR /&gt;
next i&lt;BR /&gt;
if count&amp;lt;&amp;gt;0 then&lt;BR /&gt;
EXTRUDE count,0,0,0.04, 1+2+4+16+32,&lt;BR /&gt;
    GET(NSP)&lt;BR /&gt;
&lt;BR /&gt;
VERT 0, 0, 0 !#1   center point&lt;BR /&gt;
VERT 1, 0, 0 !#2   x ward&lt;BR /&gt;
VERT 0, 1, 0 !#3   y ward&lt;BR /&gt;
VERT 0, 0, 1 !#4   z ward&lt;BR /&gt;
COOR 2+256+1024, 1, 2, 3, 4&lt;BR /&gt;
BODY 1&lt;BR /&gt;
endif&lt;BR /&gt;
&lt;BR /&gt;
Thank YOU very mutch !!!)</description>
      <pubDate>Fri, 15 Dec 2017 13:01:13 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252283#M4635</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-15T13:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to control texture angle on element created by EXTRU</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252284#M4636</link>
      <description>Glad to hear &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt;!&lt;BR /&gt;
&lt;BR /&gt;
I need to learn more about this COOR command....!</description>
      <pubDate>Fri, 15 Dec 2017 13:05:53 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-control-texture-angle-on-element-created-by-EXTRUDE/m-p/252284#M4636</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-15T13:05:53Z</dc:date>
    </item>
  </channel>
</rss>

