Freestyle SVG micro line elimination

(Zoom in if needed to get the full details.)

Drawing outlines in a manner of which a human easily does it on paper is apparently very difficult for a computer. I see the exact same issues in the Freestyle drawing, as in Solidworks Composer from Dassault Systemes, which is the world’s largest CAD corporation.

Now, getting Dassault to listen is impossible (unless you’re Boeing/Lockheed), so I wonder if the Blender developers are more forthcoming?

The simplest solution I can think of for the above problem is this:

  • Minimum line length - A filter for either Line Set/Style that removes all lines under this length.

The next level solution is perhaps along the lines of:

  • Auto-connect short lines - A filter that sorts all micro lines into groups according to their proximity, and then connects them into a single line (perhaps using maximum 2D angle detection).

I hope this sounds feasible?

Then again, is anyone even working on the Freestyle renderer these days? It seems like a highly specialized tool separate from much of Blender.

That is already there.
Under View Layer Properties Tab -> Freestyle Line Style panel -> Strokes tab -> Selection ; there is a setting called Min 2D Length.

That is what Chaining option is supposed to do. If you disable the option the result will be worst.

So why it does not give a perfect result ? Because strokes can have caps.
If you enable Round cap type instead of Butt by default, oval stroke should look correct.
You can also choose to use a Backbone Stretcher modifier to increase length of strokes.

Finally, if you want to have some short lines but not all, you can define different Line Sets using different Line Styles.

Thank you for the information!

I did not see the selection option previously, thank you for pointing it out.

Regarding the Chaining option, I do not understand it. It says “splitting” when what I was asking for is “merging/joining”. The documentation seems extremely basic regarding this, and I can’t download the example files anymore. Has someone produced a detailed tutorial?

Further, this simple setup with 1 thick line and 1 thin line seems to produce two lines placed on top of each other for each set:

Also, the lines are incredibly dense, with no linear/tangent point removal:


Check that link for the files listed in the manual if you want to look at them. They are from 2.67, no idea how compatible they are with 2.80+.

The buggy demo file is on the current site, so I expect it should work with 2.80+

No. Splitting is the next group of settings.
This tab is organized as is : Chaining, Splitting, Sorting, Selection, Caps, Dash Line

So, your screencapture correspond to a merging of end and start of closed detected lines, but after that a splitting of strokes every 100 pixels.

First off, I just tried the “face smoothenss” setting, and the render time for freestyle increased from five minutes to an entire hour (and all the time, the progress bar was stuck at 98% and a mere 15% CPU utilization in the task manager). As I work with imported CAD models that heavily rely on custom normals, I was sad to find not only this, but that it also didn’t make any visible difference.

Thank you! Found it, and tested it, and it has the exact same issue as I posted above.

There’s no reason that lines (as opposed to curves) should have that many vertices:

It makes for an unnecessarily heavy file that’s near impossible to edit (and no per-object grouping makes it even more impossible).

Ok, that confused me quite a bit. So why does "splitting " have dozens of options while “chaining” has only two? That’s why I naturally thought that the “min 2D angle” was for “chaining”…

But I guess those micro-lines were self-induced, which is good news (I was used to them from an old version of Solidworks Composer that also did them).

The result I get now I guess it’s a lot more difficult to “chain” together, since I get very large, spread out segments like these:

I’ve tried “crease angles” from 10 degrees up to 160 now and I don’t get any different results.

(Unfortunately, I think I’m going to have to give up on Freestyle in Blender for now, because the showstopper is that it’s far, far too slow. The “view map” computations take way too long, even if you just move/add tiny parts in a large file, it re-does everything and the render time goes up to several minutes (by contrast, Solidworks Composer handles any change and renders it in seconds… I know, I know… commercial software from a big corporation, vs free add-on).

Freestyle is an old project. It only ended up in 2.67 but was a gsoc during 2.4x series.
Custom Normals are more recent. Their support started in 2.74 and last feature addition about them was gsoc that ended up in 2.80.
So, Freestyle Face Smoothness option is not related to Custom Normals.
It is just related to the ability to smooth shading of only a selection of faces in edit mode.
It just means that Crease Angle value will be used for faces with Flat Shading and ignored for faces with Smooth Shading.

Wireframe shows a mesh with lots of beveled edges.
Crease Angle setting will not help in that case. Because on each side of bevel, edge loop is electable to become a freestyle line.
Sincerely, wireframe itself has difficulties to distinguish those lines. So Freestyle has no chance to do it without help.

Initial way to determine such lines is by using Suggestive Contours and Ridges & Valleys Edge Types in Line Set.
Those automatically contours were rarely satisfying by default.
That means that you have to play with Sphere Radius and Kr Derivative Epsilon values (only accessible when Advanced Options checkbox is ticked).
That is also the reason why Splitting options are numerous. To split lines obtained from those options.

That was not intuitive at all. So, other options were added.
Ability to take into account, material boundaries and edge marks.
You can make a selection of edge loops in edit mode, mark them as Freestyle edges, tick only Edge Mark option In Line Set panel. And those edges are the only one that Freestyle renders.

View Map cache option is there to avoid to redo the computation at each frame of an animation.
If you don’t make an animation, let option disabled by default.
At period, it was added, people were making scenes with less geometry.
If you were using Bevel shading node and textures for detail, that caching would be less longer.

Freestyle was created when Blender Internal was the only official render. People were used to wait 30, 45 or 60 minutes to render one frame.
It is clearly not comparable to nowadays rendertimes, with denoisers and EEVEE.

That is why LANPR is supposed to replace Freestyle in a near future.

As mentioned, I’m visualizing CAD models. They have bevels everywhere (and not clean ones either, because even after decades of NURBS to polygon translators, none of them do a good job here, hence the need to fudge it with custom normals).

Ah, thank you for the information! I’ll stick with Solidworks Composer then and try to have another go with LANPR when it becomes available.