Skip to content

Conversation

@napakalas
Copy link
Contributor

#172

  • Fixes path rendering issues where Bézier smoothing caused wavy lines and small loops at node connections.
  • Adds a --bezier-smoothing option (angle tolerance 0.1)
  • Introduces connect_centre() for use by draw_line() to improve path continuity and visual clarity.

@napakalas
Copy link
Contributor Author

Before and after update:
526821203-05ada5a1-314d-4079-aba7-d84d2985f6a6

Rendering on vagus nerve (the busiest nerve):
526821390-cbcbec8f-e131-4d21-a5e5-62bf593416b2

@dbrnz
Copy link
Collaborator

dbrnz commented Jan 27, 2026

generation_options.add_argument('--bezier-smoothing', dest='bezierSmoothing', action='store_true',
     help="Render bezier paths with angle tolerance set to 0.1")

It's not too clear what the --bezier-smoothing option is about. Where does the 0.1 come from? Looking at the code, the default is to have a tolerance of 0 -- this should be mentioned in the help text.

Which of the above pictures have the option turned on?

What value is intended to be the default when generating maps?

@napakalas
Copy link
Contributor Author

Thanks for the questions! Not sure why this ended up in my promotional folder 🙂

The --bezier-smoothing option exists to reproduce the previous rendering behavior used in earlier map generations. When enabled, it applies a non-zero angle tolerance to Bezier path rendering.

The value 0.1 comes from the draw_line implementation, where tolerance defaults to 0.1 (see the definition here):

def draw_line(node_0, node_1, tolerance=0.1, separation=2000):

In the current code path:

  • Without --bezier-smoothing, the tolerance is explicitly set to 0 (no smoothing).
  • With --bezier-smoothing, the tolerance is set to 0.1, matching the previous behavior.
    In the figures referenced above, the top-left image was generated with --bezier-smoothing enabled.

The intended default for new map generation is tolerance = 0. The --bezier-smoothing flag is therefore optional and only needed to reproduce legacy outputs.

@napakalas
Copy link
Contributor Author

Hi @dbrnz
I have updated the help message for --bezier-smoothing; it now mentions its purpose: to enable Bezier path smoothing to match legacy map rendering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants