form generation

masha's Avatar

masha

13 May, 2021 09:44 PM

Hello John!

I m trying to generate rounded forms similar to pebbles, but I dont uderstand how make it so. I only get something that looks like a polygon. Which node can helps me to make them looks like a different stones? I think I m searching for a node, or a node combination with an effect like "transform each" in illustrator

  1. Support Staff 1 Posted by john on 13 May, 2021 10:30 PM

    john's Avatar

    Hi Masha,

    The node you are looking for is round_segments. Just hook your polygon shape into that and adjust the "D" curviness factor.

    Please let me know if that produces the pebbles you need.

    John

  2. 2 Posted by masha on 14 May, 2021 02:05 PM

    masha's Avatar

    John, thanks a lot! I ve tryied "round_segments", it works. But in general only it does not serve the goal.

    I ve tryied to move the points on the elips in different position with the "wave" or "wiggle". The shape changes slightly, so there is not enough variability (like on the image in attachment)

    I think the method could be to set motion to several points at once with a small distance, maybe. I know how to move one point, but have no clue how to move 5 points in the same direction on one line (and it could change the elips form differently).

    Maybe there are another schemes? I m just not capable to find it.

  3. Support Staff 3 Posted by john on 14 May, 2021 03:10 PM

    john's Avatar

    Masha,

    I may have just the node you are looking for!

    Last year I made a node for my node library called push_pull. It does exactly what you described - it moves a subset of points in a certain direction. The following post describes it and includes the node in the attached demo:

    http://support.nodebox.net/discussions/show-your-work/386-push-pull

    Start with an ellipse or rounded polygon, then feed that into push_pull and adjust the controls to push or pull your shape relative to a moveable paddle. You can temporarily turn on "show controls" to better see what you are doing, then switch it off when you are happy with the shape.

    Give that a spin and see if it gets you the shapes you want.

    John

    P.S. I couldn't open the .rar file you attached. You might have better luck just attaching the png.

  4. 4 Posted by masha on 14 May, 2021 04:47 PM

    masha's Avatar

    Ok, cool! I m testing. At first sight it is more eggs than stones.

    PNG in attachment.

  5. 5 Posted by masha on 14 May, 2021 06:15 PM

    masha's Avatar

    That is interesting: why it is initially multi-layered?
    the first attempts are not very(

  6. Support Staff 6 Posted by john on 14 May, 2021 08:24 PM

    john's Avatar

    Hi Masha,

    Making natural looking pebbles is a tricky and subtle problem. I did some experimenting and came up with something a little closer to what you want (see attached screenshot and NodeBox file).

    I started by making a pebble shape as close to your prototype pebble as I could. Then, instead of using push_pull or wiggle I tried something else: skew. Skewing can generate a wider range of shapes. After skewing I rotated each pebble a random amount and then made them slightly different sizes using scale.

    You can try zillions of different variations by changing the random seeds. The skew node takes an X,Y value, so I used scatter to generate those. Change the width and height of rect1 to allow more or less variation in the shape, and change the scatter seed to try different iterations. You can adjust the seeds for rotation and scale as well.

    Give this a try and let me know if it works for you.

    Thanks,

    John

  7. 7 Posted by masha on 14 May, 2021 11:45 PM

    masha's Avatar

    wow! That looks like awesome, I ll try to create something with this node. Thanks for your clues, I ll write how it ll goes)

  8. 8 Posted by masha on 16 May, 2021 11:17 PM

    masha's Avatar

    Hi John, everything goes well. I d like to clarify:
    Where you get nodes "arrange"\"amount"? I didnt find them in the list.
    I tried to save file and have some troubles. It cantt save whole file, only a part. I edited "document properties" of cause many times. I can change only canvasHeigh. When I change canvasWeight it always resets. Do you know why? Is it the way it works?

  9. Support Staff 9 Posted by john on 17 May, 2021 12:04 AM

    john's Avatar

    Hi Masha,

    Arrange is one of the nodes (actually a subnetwork) from my node library. You can download it here:

    http://support.nodebox.net/discussions/show-your-work/390-cartan-no...

    To use it, just open the library and copy/paste the nodes you need into your current project. A few of them require custom code which you would also have to copy from the library folder (see the comment on each node to see if this is necessary.). I will be coming out with version 2-3 of my library sometime soon with even more nodes!

    As for Amount, that is actually just an ordinary integer node (you can tell from the icon). All I did was rename it to "Amount" to clarify its purpose.

    I don't understand why you are having trouble resetting the width of your canvas; I change mine all the time. The dialog is a bit wonky, though. You can't just tab directly from height to width; you have to double click and select the value and then completely replace it with a number and hit return to exit the field before hitting the save button.

    Please give that another try. If you get desperate, it is possible to set those values directly in the .ndbx file using a text editor, but you shouldn't have to do that.

    John

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • pebbles_generation.PNG 45.8 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

23 Jun, 2021 01:36 AM
20 Jun, 2021 07:19 AM
13 Jun, 2021 11:19 PM
06 Jun, 2021 09:27 AM
05 Jun, 2021 10:17 AM

 

05 Jun, 2021 07:45 AM
23 May, 2021 10:05 PM
23 May, 2021 10:02 PM
17 May, 2021 12:04 AM
16 May, 2021 01:00 PM
14 May, 2021 03:16 PM