2
$\begingroup$

I asked a question last week, and the answer way very useful, but I don't find a way to use this solution to scale more than 2 objects. So, is there a way to do it ?

The question:

This is the setup where I run into this problem

I want to scale 2 objects, keeping their dimensions constant but not proportional.

This is just an example:

I want to scale 2 edges, one is 1m and the other is 0.9m.

If I scale them by 2, the result should be: 2m and 1.9m.
If I scale by 3, the result should be: 3m and 2.9m.
Or if I scale by 4, the result should be: 4m and 3.9m.

...and so on.

What would the formula be?

$\endgroup$
2
  • $\begingroup$ Which edges? Which objects? ...can you describe this (with pictures) a little more precisely? $\endgroup$
    – quellenform
    Apr 2, 2022 at 10:08
  • $\begingroup$ Ok, I did, but this is just an exemple of the situation when I encounter this problem. I know I could enter the dimensions to resolve the problem, but I want to know if there is a formula to do it when scaling. $\endgroup$
    – User
    Apr 2, 2022 at 12:32

2 Answers 2

2
$\begingroup$

If I understand correctly, you have:

$a = 1$

$b = 0,9$

And according to your data, $b$ is always smaller than $a$ by a certain value.

If $x$ is your multiplier, then it should look like this:

The length of the longer line: $a * x$

The length of the shorter line: $a * x - (a - b)$

Here is the whole thing translated 1:1 into Geometry Nodes:

enter image description here

$\endgroup$
4
  • $\begingroup$ Thank you! I realy like that solution! $\endgroup$
    – User
    Apr 2, 2022 at 13:42
  • $\begingroup$ How could it be used with 3d objects ? For exemple, scaling a cube on the x axis only? $\endgroup$
    – User
    Apr 2, 2022 at 14:47
  • $\begingroup$ With this example you can actually scale as many objects as you want. You would only have to adjust the nodes accordingly. But I honestly don't know what you are trying to achieve. What should be the final result? With GNs, there are usually many ways to reach the goal, and it is difficult to reach a generally valid answer to all use cases for trivial questions. $\endgroup$
    – quellenform
    Apr 2, 2022 at 14:54
  • $\begingroup$ Well, I work on a project to make fast modular buildings, so it's better if it's not organic. So I try to find a way to have precise control on the scaling of different objects. If I can find a way to do as I said, scaling 2 cubes like that on a single or two axis, it will have many applications afterward. $\endgroup$
    – User
    Apr 2, 2022 at 15:31
2
$\begingroup$

Assuming:

  • $a = short\ piece$
  • $b = difference\ between\ them$
  • $a + b = long\ piece$

If we were to multiply (scale) the long piece by the number $m$, we would get $m\times(a+b) = ma + mb$.

For the short piece we want all of that, except we want one less "difference", i.e. $ma + (m-1)*b$.

enter image description here

Your question, in short, becomes: What can I multiply $a$ with so I can get $ma + (m-1)b$? The answer is: $$multiplier + \frac{(multiplier-1)*b}{a}$$

In Geometry Nodes, it would look like this:

enter image description here

$\endgroup$
8
  • $\begingroup$ Thank you, it's very useful! Now, how could it be used with 3d objects ? For exemple, scaling a cube on the x axis only? $\endgroup$
    – User
    Apr 2, 2022 at 14:47
  • $\begingroup$ That's actually exactly what I'm doing in the screenshot. Do you see the "Combine XYZ" nodes? I'm only using the X channel so only that part is affected. The only difference is that you would make the Y and Z channels "1" instead of "0" so they don't change. I was using lines in this example so it wasn't important here. $\endgroup$
    – Kuboå
    Apr 2, 2022 at 14:49
  • $\begingroup$ I tried this solution with 2 cubes, with the intent of scaling them only on the x axis, but the 'long piece' one is scaling on the other axis as well $\endgroup$
    – User
    Apr 2, 2022 at 15:25
  • $\begingroup$ Did you use a Combine XYZ for it as well? I don't have it in my screenshot, but you should. $\endgroup$
    – Kuboå
    Apr 2, 2022 at 15:29
  • 1
    $\begingroup$ Ah ! I got it! Many thanks ! you rocks! $\endgroup$
    – User
    Apr 2, 2022 at 15:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .