Controlling UV spacing


#1

I’m trying to create a surface divided into quads which are driven by a distance in UV input, not just numerical division… so that I can automate placed adaptive components to make facades in an irregular pattern like below…

Gridded Facade

 

 

I firstly need to create a stepped sequence of numbers, something like 0,600,1800,3600,4200,5400,7200,7800,9000,10600 (adding 600,1200,1800 and repeating). How can this be done within a codeblock?

Then I want to divide a face into quads who’s U-division spacings are driven by the stepped distance sequence, not the typical UV-number divisions. Is this possible?

Thanks!

 


#2

I think that this is what you’re looking for:

2014-08-21_131222

numbers

I needed to use some python to get the number sequence, because I think it would take too many nodes to set it up and my design script skills are still lacking.

I’d love it if someone could show me how to do this in DS.

 


#3

Hi,

Are you thinking only in flat surfaces or in any type ?. At the moment that you are playing with double curvature is very difficult to work with distances instead of parametric division (from 0 to 1). One possible way is to think in a first basic modulation, and divide every part in the no regular steps. A small DS function can make the trick
02

I have done it very fast, probably you can refine it quite a bit. The fist basic modulation is " DivU1=0…1…#NDiv; ". Imagine NDiv=11 so 0,0.1,0.2,0.3…etc. The Little DS function is taking every number and the next(for example 0.2 and 0.3) and making the intermediate division following the steps. For example steps like 0,0.15,0.3,0.7 and 0.8…will give us 0.2,0.215,0.23,0.27, and 0.28

def SteppedList(N1,N2,Step:var[])
{
Rn=(N2-N1)*Step;
return=N1+Rn;
}

DivU1=0…1…#NDiv;
NU1=0…NDiv-2;
NU2=1…NDiv-1;
DivU2=SteppedList(DivU1[NU1]<1>,DivU1[NU2]<1>,StU);
Flatten({DivU2,1});


#4

Thanks guys, very helpful!

  • Dimitar, the number sequence method is exactly what I needed for the linear facades I am working on. Thanks!

  • Eduardo, I hadn’t intended to try this method on double curving surfaces, but have had a play and your method is great thanks. I had noticed though, whilst trying to place adaptive components with your node “Quads From Points List” that when the points where lined into a “AdaptiveComponent.ByPoints” node they returned all Can’t make type errors. I simplified my adaptive component to a single width form and it made the bowtie-looking flipped families below. Have you experienced this? I went into your quads node and amended the order of the points as follows and it worked perfectly (2nd Image):

def QuadAtPointIndices(NetPts: var[][],N1,N2)
{
Pt1=NetPts[N1][N2];
Pt2=NetPts[N1][N2+1];
Pt3=NetPts[N1+1][N2];
Pt4=NetPts[N1+1][N2+1];

return={Pt1,Pt2,Pt4,Pt3};
}
BowtieFlat

 


#5

This just means that the order of your Adaptive points was not the same as the function was expecting.


#6

A very educational post once again, Eduardo! Thank you so much for that solution.


#7

Hello Samuel Higgins,

Try to arrange your Adaptive Components point sequence as per you array of Point.

I got this kind of Problem earlier and solved by rearranging Adaptive Component.

Hope this will be helpful.

Thanks Eduardo P. Roca, Dimitar Venkov for educating other users.

Keep using Dynamo!

Thanks,

Ritesh


#8

Thanks Samuel, for pointing the problem of the order of the points. The custom nodes “QuadsBySurface” and “Quads From Points Lists” were done a bit in a hurry for requirements of users in this forum, in a context of creating all the geometry in Dynamo. They weren’t tested for making adaptive components. I will upload new corrected versions.


#9

This post is still great!

I am currently pushing it a bit further.

I would like to control the UV divisons with a random patterns out of 3 numbers…

Say that the permutations of 3 numbers are 6. (abc, acb, bac, bca, cab, cba) if I am not wrong

I would like to divide the surface by a random series of those 6 permutation…

(in the meantime I am studying pyhton)


#10

I came close to my objective, variating the Venkov file, inserting a shuffled and flattened list,

however my python skills are not enough to get to the last step (I am currently studying the 2.7).

I wrote a little python function that creates a newlist from a list where every element is the sum of the previous ones. On the python idle works fine…here not…I miss something.

any help would be great!

bandicam 2015-03-04 14-55-20-844

Veknovnumbers-variazione


#11

Hi,

Just one more step! The only thing left to do was to apply your function. The easiest way to do that is to add it straight away to the so-called “OUT” which is the return list of the Dynamo Python Script node.

The Python Script node takes in exactly one list called “IN” and returns only one list defined as “OUT”. Both of those lists can have multiple sub-lists, so the general practice is to specify the index of the incoming lists. Great work :slight_smile:

2015-03-05_110952


#12

Combinaliste Thanks for following up.

Now I would like to get rid of the same sequence with the horizontal line that would follow a more mundane spacing…

Pardon me as I am a beginner since I did not fully comprehend the sense of the function x/y. Is it for having the same sequence on both

U and V space? If so, I just need to substitute it with another thing to reach my goal (?).

p.s. I also added a joining list node to re-enter the first element, since the Flatten node expelled it…


#13

Your assumption is correct. The U and V parameters represent the coordinates of a point bound to the surface, normalized to the range between 0 and 1. (i.e. if we have a flat surface that is 1 meter long and wide, the point at 0.5U and 0.3V would be 0.5 meters from the corner of the surface at a height of 0.3 meters)

Therefore if you provide a different range for V, you can control the vertical spacing.