Convert a maze image to curve lines

Hi,
I am using Blender 3.0Alpha version.
Does anyone ever try to convert an image into a single curve line.
In my case I like to get a “maze” image and convert it to single bezier curve line?

I tried using “Convert>Trace Image to Grease Pencil”
Then “Convert” Greaze line to Bezier curve.

The problem is the result is not a single Bezier curve but 2 curve lines.
What I needed is “single line”

Results is 2 lines … and not 1 line that I needed.
How to make it 1 line instead ?

Another problem is this “Convert > Trace Image to Grease Line” only works for half the image. It cannot trace the entire “Maze” image ?!!!

Well tracing is made for exactly this: tracing the contour. If you wanna find something like the skeleton there are other ways (but not in blender afaik). Another possibility might be to look after labyrinth generators which get you a vector format (or of course just do manually if this is just for one).
You may have a look at www.mazegenerator.net save as svg and import in blender as Grease Pencil … and convert to Bezier.

1 Like

Hi Okidoki,
Any tips what other ways to get just skeleton and import into Blender as “skeleton” too ? I need a flexible “maze” … so not just one pattern.

The web site you provided is exactly how I intent to get a couple of maze pattern . but as mentioned, it “traced” as contours (double lines) either with Blender Convert>trace image to grease pencil method or one other tool I used - Inkscape.
Same problems with both.

Hi Okidoki,
I wanted to let you know that in “Inkscape” after converting the “maze image” to “path” using bit map tracking, the results in “Inkscape” shows only as skeleton - 1 line/path.

The problem is when I import into blender as “svg” file, the output in blender still shows “contour” (2 lines) …

Is there a special way to import “svg” file (with just contour) with output as contour in Blender too?

Well, i saved as SVG from website, then import SVG as Grease Pencil (because pure SVG gives multiple curves) and then Object convert bezier:


Or maybe just: GitHub Gorgious56 MazeGenerator ?

Hi Okidoki,

Thanks for your advise. I was busy on rendering some large landscape … took up a couple of my days :slight_smile:
Well thanks for your advise … I tried a few methods but I finally think the idea of saving SVG from website will do the trick.

However I have yet another problem, … how do I distribute even spacing of “vertices” on curve line? (skeleton)? I intent to put “square bushes” so that I have bushes on this skeleton lines.

What I read so far … mostly talk about “using subdivide” manually … not much about script or some auto way to do it. Any advise of any existing python script that can create even spaced vertices across this entire maze?

And this lines have to be bezier curves ?? If you convert to mesh, you can select one inner vertex in line a select similar (shift - G) amount of adjacent faces and dissolve, so you get a clean mesh and any edges can be subdivided or if the vertices are enough and only should be LoopTools Addon can do even spacing on meshes…

Hi Okidoki,
I can do it in mesh … but there’s so many lines … wonder if there’s such python script that can do this that you know? Or I just have to do this manually …

Anyway I tried the “subdivide” approach mentioned but cannot get all evenly spaced vertices, so can’t get continuous bushes around the skeletong.

As for the looptool addon … can you provide more specific instruction how I can solve this?

Here’s diagram to show you where I am with this “subdivide” approach on mesh.
![Maze_Greaseline_2_BezierCurve4|626x500]


after subdivide

Adding bushes to vertices …

So results still can’t fill all “skeleton” …

If you want just a few maze, you can select an edge which have 2x length of shortest, select similar length (adjust treshhold) sub divide 1x, dito for edge 3x length subdiv 2x,… switching between edge and vertex select mode shows you the needed subdivs. There arenot so much longer then 5 or 6… maybe wanna merge the vertex by distance because they aren’t connected ??

I am using Blender 3.0A.
In this “skeleton maze”, whenever I use select an edge with “select similar.Length” in edit mode, it always select all edges instead. That include any length of edges, including 0.5 x smaller or 0.25 smaller.

Is there any other way to select edges with “Same” length in Blender?

(adjust treshold)

meaning smaller values

Ah ok … the threshold value. Appreciate all your help to speed up my work … Okidoki.