Extracting Organic, Smooth Region Boundaries from Electric Field Lines

Hello everyone,

I’m working on a project to design architectural floor plans based on electric field line simulations. As shown in the attached image, there are field lines generated by multiple charge points, and I’m trying to extract organic and smooth boundary lines (like the green/purple lines) that delineate the influence regions of each charge.

I’ve been attempting to generate these boundaries using Grasshopper Python scripts, but I’ve encountered several issues and am struggling to find a viable solution.

[Target Outcome Image]
(Please upload the image file you attached here.)

[Methods I’ve Tried and Their Problems]

  1. Method: Back-tracing Grid Mapping + Mesh Vertex Colors (Colored Mesh Output)

    • Description: I generated a grid over the entire work area. For each grid point (or cell), I back-traced against the electric field vector to find the nearest positive charge, assigning it as the ‘owner’ of that point. The mesh vertices were then colored according to their owner ID.

    • Problem: While the influence regions of each charge were visually differentiated, the boundaries appeared blurry and blended due to color interpolation across mesh vertices. I couldn’t achieve sharp, clear boundary lines. This method ultimately served more as a visualization than as an extraction of the actual boundary lines.

  2. Method: Tracing Null Points (where the vector sum of forces is zero) / Separatrices

    • Description: Theoretically, the boundary lines where electric field flow changes direction (separatrices) often pass through null points where the net vector sum of forces is zero. I attempted to find and trace these lines to define the boundaries.

    • Problem: With multiple charges, precisely locating “null points” where the vector sum is exactly zero proved extremely difficult in a computational simulation environment. This method was also prone to noise, and the traced separatrices did not consistently form clean, continuous curves, making it hard to achieve the desired outcome. While theoretically sound, practical implementation for stable and smooth results was challenging.

[Desired Outcome]
I’m looking to obtain sharp, smooth, organically flowing region boundary lines (NURBS Curves) that follow the electric field lines, similar to the green/purple lines in the attached image. Computational efficiency is also a key consideration.

Are there any effective approaches or ideas within Grasshopper (including Python or plugins) that could help me extract these types of boundaries, overcoming the problems I’ve faced so far? Any methodological advice would be greatly appreciated.

Thank you.

It looks like you’re after the Morse-Smale complex of the field.
I started looking at this, and made something for identifying the saddle points here:


I didn’t go as far as tracing the separatrices, but this does seem like the right way to go (start from the saddle points, and follow the gradient in both ascending and both descending directions until reaching a maxima/minima). It looks like the implementation of this tracing is the problem in your script.

offtopic, but :
Wow awesome, discourse definitely needs cool topics list. As its full gold nuggets play around, but they are not easily found.

Cool to discover names of mathematic tools. I manage to do that
For each face center I made a curve that follows the flow upward, so if I end close to a source point I gave the face an integer number.


Then I subdivide the mesh using the “material”
Far from perfect but works on 3d also.


Presentation of charge as Radius

Everybody thank you all so much for your insights!

This whole process feels a bit like an “irregular Voronoi” or a “weighted Voronoi” diagram in spirit. While the specific boundary shapes derived from some of these approaches might differ slightly from the exact lines I envision, the logical explanations and terminology provided (like “Morse-Smale complex”) have been incredibly helpful in broadening my perspective. I’m truly grateful to have learned about these methods, as I’m sure I’ll find opportunities to apply them in future projects.

This is my first time diving deep into Rhino and Grasshopper, and it’s certainly challenging, but solving these complex problems brings a unique sense of accomplishment.

I appreciate for your time and effort in helping me navigate these challenges. Thank you all again!