Some advice for a project

Andy's Avatar

Andy

17 Mar, 2021 07:29 PM

Hello all! I am working on a project where I need to create a surface map of a circuitry-like pattern around a cube. I'd like the lines of the circuits to seamlessly wrap around the surface of the cube and also to follow the contours of the circles in the middle of each face. I've attached an example I made by hand to demonstrate what I'm after. This pattern works, but I'd like to be able to add variation to it. I am totally new to this tool, but I'm sure that NodeBox is perfect for this project. I am seeking any assistance or advice on how to best proceed. Thank you!

  1. Support Staff 1 Posted by john on 18 Mar, 2021 12:11 PM

    john's Avatar

    Hi Andy,

    What an interesting project! Yes, this is perfect for NodeBox. Generating the basic layout is easy, but creating aesthetically pleasing circuitry is tricky, even more so if you want each face unique but with connections that match along edges when the cube folds up.

    I took a run at it just to give you a start, but I am not pleased with my initial approach (see screenshot and attached ndbx zip file). I made a handful of high-level nodes (actually subnetworks) which provide an outline of my algorithm. Render each node to see how the final product comes together and control click and choose Edit Children to see how each one works:

    • Layout lets you define the size of the circles and the margin between each circle and the edge of its face. It returns six faces, each a group consisting of a circle and surrounding square. As you adjust the diameter and margin settings the circuitry adapts (which is fun to watch).
    • Connections takes the six faces as input and returns a series of straight line connecting points around the edge of the circle and the nearest edge of the surrounding square. You can set the density (the number of connections per each quadrant) - also fun to adjust.
    • Bend takes all the line segments generated in the previous step and bends them by adding right angles and random diagonals. It requires four parameters to control the bending:
      • direction: 0 = vertical, 1 = horizontal
      • first bend: a percentage along the line where the first bend occurs
      • second bend: a percentage for the second bend
      • cutoff: the percentage in the first bend above which the bending should be simplified; this cleans up the shorter connections in the center of each quadrant
    • End Points adds a little solder point at the beginning of each connection around the circle.
    • Decorations adds a few superfluous segments to fill open spaces. The current decorations don't scale well and are fairly crude; they are just there to as a placeholder for more elaborate designs.

    As you can see, the result is interesting, but probably not what you are trying to achieve. The connections match perfectly, so if you printed this out and folded it to form a 3D cube, all the lines would sync up. But the faces are too orderly - almost identical - and the overall effect does not convey the kind of circuitry you included in your sketch.

    I think a better approach would be to make a circuit like pattern that fills each square face and then use a compound node to cut out a circle in the middle of each face. You could then automatically place little dots at the point near the edge of the circle.

    You seem to have a knack for making interesting looking circuit tiles, which you can make in Nodebox by drawing a random series of lines and boxes. You can use my layout node to create your faces and study my connections node to see how to draw lines from the edges of each square. If you build each face from the same connection points along the edges they will connect properly when folded even if the interior of each face is different. If you need help punching out the circular hole let me know.

    I hope this helps get you started. It doesn't achieve the effect you are going for, but it should give you a feel for the way NodeBox works. Please write back and share your progress. If you get stuck I will be happy to work with you some more on this.

    John

  2. 2 Posted by Andy on 18 Mar, 2021 08:27 PM

    Andy's Avatar

    Hey John, thanks for the reply! I looked at your example and it was very helpful, though a lot of it is over my head as I am very new to nodebox. I do think your idea about making a circuit pattern to fill each face is the way to go, however. I got started on this and I've attached my work.
    Here's the steps I've taken:
    • Create a rectangle
    • Use resample to put points along the rectangle edges (42 on each edge in my example - the 3d box will eventually be subdivded into 42 squares to accommodate other aspects of the design)
    • Remove the corner points (i foresee weird things happening with those, so i'm ditching them up front)
    • Randomly select points from the edge (black dots)
    • Create a grid for the interior of the face (red dots)
    • Randomly select points from that grid

    Next steps as I see them are:
    • Make the six-face upside-down cross pattern with this face and have the faces share the black border dots (that way its seamless)
    • Generate unique random interior points for each of the six faces (the red dots)
    • Run something over the entire thing to connect the black dots to the adjacent red dots such that the angles are 180, 90, or 45 degrees and do something about circuit length (random length in unit of points connected vs. end condition)
    • Run something that looks for adjacent unconnected red dots and connect those (to make the squares and fill empty spaces - probably a lot of options for this)
    • Cut out the circles
    • Add hollow dots to some of the lines to make it look more circuit like

    I am going to keep working on this tonight but I have to do my professional job-related work now. I'll upload my progress as I go. Thank you again for your help John! Any feedback or suggestions would be wonderful and hopefully help other nodebox users as well.

  3. 3 Posted by Andy on 18 Mar, 2021 08:30 PM

    Andy's Avatar

    Hey John, thanks for the reply! I looked at your example and it was very helpful, though a lot of it is over my head as I am very new to nodebox. I do think your idea about making a circuit pattern to fill each face is the way to go, however. I got started on this and I've attached my work.
    Here's the steps I've taken:
    • Create a rectangle
    • Use resample to put points along the rectangle edges (42 on each edge in my example - the 3d box will eventually be subdivded into 42 squares to accommodate other aspects of the design)
    • Remove the corner points (i foresee weird things happening with those, so i'm ditching them up front)
    • Randomly select points from the edge (black dots)
    • Create a grid for the interior of the face (red dots)
    • Randomly select points from that grid

    Next steps as I see them are:
    • Make the six-face upside-down cross pattern with this face and have the faces share the black border dots (that way its seamless)
    • Generate unique random interior points for each of the six faces (the red dots)
    • Run something over the entire thing to connect the black dots to the adjacent red dots such that the angles are 180, 90, or 45 degrees and do something about circuit length (random length in unit of points connected vs. end condition)
    • Run something that looks for adjacent unconnected red dots and connect those (to make the squares and fill empty spaces - probably a lot of options for this)
    • Cut out the circles
    • Add hollow dots to some of the lines to make it look more circuit like

    I am going to keep working on this tonight but I have to do my professional job-related work now. I'll upload my progress as I go. Thank you again for your help John! Any feedback or suggestions would be wonderful and hopefully help other nodebox users as well.

  4. Support Staff 4 Posted by john on 30 Mar, 2021 09:34 AM

    john's Avatar

    Hi Andy,

    My apologies: for some reason your replies were sent to the spam folder, so I only just now noticed them. Our antiquated forum software does this every now and then. Vexing for both you and me!

    Anyway, it looks to me like you're off to an excellent start. I think using pick to remove random dots is clever. As you say, there are a lot of options for hooking them up and filling empty spaces - this part will be tricky and will require experimentation to get the right look and feel. Fortunately Nodebox is quite good at experimentation.

    You can probably use the reflect node to get your edge dots to match up, Be careful - there are two reflect nodes; you want the black one that outputs geometry.

    Again, my apologies for our over-eager spam detection. I hope you will keep working on this and keep me posted.

    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

  • pattern.jpg 1.19 MB

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

15 Apr, 2021 06:22 AM
14 Apr, 2021 11:34 PM
13 Apr, 2021 09:20 AM
04 Apr, 2021 10:50 PM
04 Apr, 2021 10:20 PM

 

02 Apr, 2021 06:14 AM
30 Mar, 2021 09:34 AM
30 Mar, 2021 08:52 AM
28 Mar, 2021 02:58 PM
26 Mar, 2021 03:13 AM
26 Mar, 2021 12:46 AM