[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
Advertisement