It was working normally and suddenly… Where could there be a mistake, what happened?
Q1.gh (10.4 KB)
It was working normally and suddenly… Where could there be a mistake, what happened?
Your curve is not internalized.
No wires are connected to your Range output, or your Expression component, or the ‘B’ input of your Division component.
P.S. By the way, when the ‘Display | Draw Full Names’ option is used, the Expression component breaks (very old bug) because ‘Variable x’ and ‘Variable y’ don’t match the ‘x’ and ‘y’ used internally. The solution is to rename the inputs or avoid ‘Draw Full Names’.
A curve is a straight line. Everything was working normally and suddenly this happens. In any new file, when I open Expressions, it is red.
Q1.gh (7.4 KB)
As before -
And see my P.S.:
I don’t understand what is internalized…
I mean, everything was working normally, then I switched something and this happened and I can’t get it back.
Right-click the Curve param and select ‘Internalise data’ so the curve stays in the GH file. Or draw the line in GH…
Read my previous posts more carefully.
This image looks like you are using icons? Turn them off.
I don’t want your .pdf file. Please read all of my previous posts more carefully.
In general, it’s a bad idea to do math operations on ‘t’ values.
The biggest problem, however, is the very old bug regarding ‘Variable x’ on the Expression component when switching between ‘Draw Full Names’ or not.
There will probably be an error, because I switched views for the tutorial. Your script is already working. Thank you very much.
I’m really not sure what your code is trying to do?
Lines behave differently than curves with regard to ‘t’ values - it’s hard to explain… But whatever you are doing, ideally it will work the same on both lines and arbitrary curves. ‘t’ values may not be what you think they are - a common mistake.
On that PDF k u it is drawn that I need to divide the line into 4 or 5 or 10 segments with different proportional lengths with a multiple of 1.1
I also didn’t manage to save them consecutively, but the end points were different, which would correspond to the lengths. They were just from point 0
1.1…1.2…or The golden ratio
I added another Script there. But he works in the opposite way, that is, he adds enlarged curves. It just needs to be stretched at least approximately to the desired total length. And that’s why I wanted to divide the exact length of the curve into such proportional parts.
I’m an eternal beginner and I don’t know anything at all.
Q1_2024_Jul25a.3dm (2.7 MB)
Q1_2024_Jul25a.gh (25.0 KB)
From Chat GPT: Sure, here’s the translation:
To calculate the lengths of individual segments of a curve with an overall length of 1000 mm and a ratio of 1.1 between each subsequent segment, follow these steps:
Sum of Ratios:
[
\text{sum_of_ratios} = 1 + 1.1 + 1.1^2 + 1.1^3 + 1.1^4
]
[
\text{sum_of_ratios} = 1 + 1.1 + 1.21 + 1.331 + 1.4641 = 6.1051
]
Length of the first segment:
[
\text{first_segment_length} = \frac{L}{\text{sum_of_ratios}} = \frac{1000}{6.1051} \approx 163.78 \text{ mm}
]
Lengths of individual segments:
[
163.78 + 180.16 + 198.18 + 218.00 + 239.80 = 999.92 \text{ mm}
]
Cumulative rounding errors may cause the result not to be exactly 1000 mm, but the difference is negligible.
You can now use these lengths in Grasshopper for proper curve division.
Panel component:
Mass Addition (first):
Shatter:
C
input.T
input.OK, I asked for that. Please note that we are now talking about how to solve a puzzle rather than “Expression is red” per the thread title.
I have no use for more files or Chat GPT results and didn’t look at them.
It may not be the only way or best way to get this series but the first thing that leaped to mind is an Anemone loop, in the white group below. This code has many temporary text panels to see results at every step. This will work on lines or curves of arbitrary length. The key sliders are ‘Steps’ and ‘Factor’ (blue group, set to 1.1). Both can be changed, as can the length of the line (curve).
P.S. Silly. There is no need for Range and Shift and Lng, they were unused. Simpler.
Check this out. Back to your code, no Anemone loop. I reached for Anemone because my math is rusty but these points from your original Expression are extremely close to the Anemone Points I obtained with the loop. Close enough?
I don’t know why this works so well, perhaps you do?
P.S. Again, I don’t understand the math well enough to know why these values are close to my “Anemone Points” (or which method is more correct?), but in my typical “shake it and break it” fashion, I added a slider to nudge the 1.4 value until the points match to three decimal places using 1.464252 instead of 1.4. Does this make any sense to you?
Unfortunately, I can’t install Anemone. It’s probably only for Win… But it would meet my requirement anyway. It’s probably exactly what I’m looking for…
According to the image from Anemone, I can see that your code is also getting closer, but point 0 is not point 0 but point 1
Q1_2024_Jul25ddd.3dm (2.7 MB)
Q1_2024_Jul25ddd.gh (21.7 KB)