[Plugin] Pic2Shape - v1.1a - 20 Mar 25 (Image Contouring)
-
The information on Pic2Shape is maintained on the Plugin Home Page of Pic2Shape. This is also where you can download the RBZ file.
- LibFredo6: v15.2a or above
- Sketchup version: SU2018 and above
- Platform: Windows and Mac OSX
- Usage: Free
If you land on this page and are unfamiliar with how to install Sketchup Extensions such as LibFredo6 or how to register on Sketchucation, please watch this video or refer to the Plugin page of LibFredo6.
Pic2Shape extracts contours from images as faces / edges geometry.
The contouring is based on pixel transparency, which can come from the image itself (in PNG), or from filtering in / out colors. The geometry can be generated as:
- Just contours
- Faces with default material
- Faces textured with the image
- FaceMe component
No documentation for the time being. Please watch the video
Overview and Main Concepts
-
This is worthy successor to my oldie ImageTrimmer - much faster and with better in-built toolset...
Can't wait to try it ! -
Thanks TIG... Now released
-
Very cool! Thank you sir!
-
There's a serious problem (based on what I saw in YT video) with jaggedness. the plugin needs some contour refining\smoothing\straightening engine.
-
You can do smoothing of curves afterwards, with dedicated tools. It's difficult to do it appropriately when extracting contours from the image, because there are too many situations.
And of course, without the plugin, you can always draw over the image with arcs, splines and lines....
-
Feel free to cannibalize parts of my ImageTrimmer, which smooths jaggedness...
You pass the edges' collected vertex points, and set an epsilon factor... thus.
### epsilon is a float perhaps < 0.2 ### perhaps it's set by the user ? experiment for best default... ### the vertices are collected from the current outline[s] points = vertices.collect{|v| v.position } simplified_curve = douglas_peucker(points, epsilon) ### might return [] simplified_curve << simplified_curve[0] if simplified_curve[0] ### so it 'loops' edges = some_entities.add_curve(simplified_curve) if simplified_curve[0] ### sort out edges' faces, hide edges etc as desired
the 'douglas_peucker()' method is this...
### http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm ### http://en.wiki.mcneel.com/default.aspx/McNeel/ PolylineSimplification.html ### def douglas_peucker(points, epsilon) ### return points if points.length < 3 ### Find the point with the maximum distance dmax = 0 index = 0 line = [points.first, points.last] 1.upto(points.length - 2) { |i| d = points[i].distance_to_line(line) if d > dmax index = i dmax = d end } ### If max distance is greater than epsilon, recursively simplify result = [] if dmax >= epsilon ### Recursive call recResults1 = ImageTrimmer.douglas_peucker(points[0..index], epsilon) recResults2 = ImageTrimmer.douglas_peucker(points[index...points.length], epsilon) ### Build the result list result = recResults1[0...-1] + recResults2 else result = [points.first, points.last] end#if ### return result ### end #def
-
Thanks TIG.
Pic2Shape already includes a simplify method, more sophisticated that the Douglas Peucker algorithm.
The real issue is that the smooting is a matter of mixing local and global scale, but also boundaries of pixels, which itself is not always clean. -
it'd be interesting to process this fence in free inkscape for comparison
-
Please do it and report.
DXF conversion is likely to give better results.
-
I was about to try this extension out - using SketchUp 2025 Pro, but the extension doesn’t seem to process the image. Image size 155x50 mm / 300 pixel/inch.
After 10 minutes still at Initialization…
Is there any guideline on max/ recommended picture size?
I tried it with a smaller resolution image, but I still can not get through Initialization....
Thank you
-
update: I succeeded with the plugin, when I opened the image in a new file.
The original image was on a bent plane. I suppose that was the problem…
-
@kimga Are you going to to have trees with this amount of edges per leaf ) ?
-
-
Do you have the model for me to explore the issue.
-
I installed Fredo6 Pic2Shape but can not find it anywhere to use it. What gives?
-
@schramdesigns Have you met the requirements in the top post?
-
I installed this and cant find it to use it.
-
That suggests you either haven't installed Libfredo or you have not restarted SketchUp. But since you are omitting lots of info to help us understand fully its hard to say.
Advertisement