tralala
September 20, 2011, 4:47pm
1
Hello, i created a program that allows to convert an image (silhouette) into a 3d shape.
I used Jts library that allows to perform boolean operations(union,intersection,etc), simplification and triangulation of 2d polygons.
Download : Shape3D
More Images :
original image
polygonized
Simple symmetry Y
Simple Symmetry X
4 Likes
wezrule
September 20, 2011, 5:56pm
2
very cool, thx! Perhaps this can also be used also to create 3D text, which we donât have (AFAIK)
1 Like
Sploreg
September 20, 2011, 6:14pm
3
Having this as a plugin for the SDK would be very useful. Nice work tralala
sbook
September 20, 2011, 9:07pm
4
Looks awesome! Big +1 for using JTS
madjack
September 20, 2011, 9:26pm
5
Really nice! Maybe I could find a use for that⌠Probably not, but itâs still great anyway.
normen
September 21, 2011, 3:20pm
6
Yeah, definitely cool stuff, and as @sbook said, a plugin would be awesome But I guess it can also be useful as a game library, anyone know the âdraw a planeâ feature of âEye Petâ from PS3?
sbook
September 21, 2011, 3:38pm
7
normen said:
Yeah, definitely cool stuff, and as @sbook said, a plugin would be awesome :) But I guess it can also be useful as a game library, anyone know the "draw a plane" feature of "Eye Pet" from PS3?
@Sploreg actually said that ;)
@tralala , are you planning on putting this under version control at some point? It seems like you've already got SVN set up over at Google
tralala
September 21, 2011, 3:51pm
8
i will try, this is my first time.
phr00t
September 24, 2011, 2:13pm
10
Hey @tralala
Iâm going to try and use this Shape3D code in my 3079 game â thank you!
I had to give it a package name (e.g. âShape3Dâ) to import it properly and use it as a library (suggest you do the same for a future update)
sbook
September 24, 2011, 2:16pm
11
@phr00t just an FYI, typical package naming conventions are all lower case⌠so it would probably end up as âshape3dâ
phr00t
October 2, 2011, 2:10am
12
Aieet @tralala
Iâm playing around with this â trying to integrate it into my game. Unfortunately, I sometimes get this crash:
[java]com.vividsolutions.jts.geom.TopologyException: found non-noded intersection between LINESTRING ( 19.0 2.0, 19.0 1.9999999999999996 ) and LINESTRING ( 19.0 1.9999999999999996, 19.0 2.000000000000001 ) [ (19.0, 2.0, NaN) ]
at com.vividsolutions.jts.noding.FastNodingValidator.checkValid(FastNodingValidator.java:126)
at com.vividsolutions.jts.geomgraph.EdgeNodingValidator.checkValid(EdgeNodingValidator.java:94)
at com.vividsolutions.jts.geomgraph.EdgeNodingValidator.checkValid(EdgeNodingValidator.java:59)
at com.vividsolutions.jts.operation.overlay.OverlayOp.computeOverlay(OverlayOp.java:170)
at com.vividsolutions.jts.operation.overlay.OverlayOp.getResultGeometry(OverlayOp.java:127)
at com.vividsolutions.jts.operation.overlay.OverlayOp.overlayOp(OverlayOp.java:66)
at com.vividsolutions.jts.operation.overlay.snap.SnapIfNeededOverlayOp.getResultGeometry(SnapIfNeededOverlayOp.java:62)
at com.vividsolutions.jts.operation.overlay.snap.SnapIfNeededOverlayOp.overlayOp(SnapIfNeededOverlayOp.java:25)
at com.vividsolutions.jts.geom.Geometry.union(Geometry.java:1361)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.unionActual(CascadedPolygonUnion.java:369)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.unionUsingEnvelopeIntersection(CascadedPolygonUnion.java:328)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.unionOptimized(CascadedPolygonUnion.java:299)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.unionSafe(CascadedPolygonUnion.java:274)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.binaryUnion(CascadedPolygonUnion.java:219)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.binaryUnion(CascadedPolygonUnion.java:193)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.unionTree(CascadedPolygonUnion.java:139)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.reduceToGeometries(CascadedPolygonUnion.java:243)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.unionTree(CascadedPolygonUnion.java:137)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.reduceToGeometries(CascadedPolygonUnion.java:243)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.unionTree(CascadedPolygonUnion.java:137)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.reduceToGeometries(CascadedPolygonUnion.java:243)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.unionTree(CascadedPolygonUnion.java:137)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.union(CascadedPolygonUnion.java:127)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.union(CascadedPolygonUnion.java:73)
at com.vividsolutions.jts.operation.union.UnaryUnionOp.union(UnaryUnionOp.java:174)
at com.vividsolutions.jts.operation.union.UnaryUnionOp.union(UnaryUnionOp.java:93)
at com.vividsolutions.jts.geom.Geometry.union(Geometry.java:1435)
at Shape3d.ShapeUtilities.combineComponents(ShapeUtilities.java:148)
at Shape3d.ShapeUtilities.createShape(ShapeUtilities.java:52)
[/java]
This is the image that seems to be causing it so much trouble:
http://i.imgur.com/WvRQC.png
Any suggestions?
Thanks!
hello i tried it and it crashed as you said.
However it worked normally when i used it with a slighly modified picture:
http://i.imgur.com/TSTSJ.png
I will post in 5 min the reason why your original image crashes.
it just crashes because it is too small in size :
just doubling the size in any paint application will make it works.
Maybe i should do a check if image too small to scale automatically
ps. i cannot upload the x2 size image, because imgur hates me.
LINESTRING ( 19.0 1.9999999999999996, 19.0 2.000000000000001 ) [ (19.0, 2.0, NaN) ]
You've got a "NaN" (Not a number). That can't be good.
phr00t
October 2, 2011, 3:22am
16
What is it about small pictures that cause it to crash? I suppose I could scale up my picture, but Iâm curious as to why that is necessary?
Thanks for looking into it so quickly!
EDIT: I also noticed the NaN which can never be good
Jts doesnt support the third dimension (Z value) which means it always has NaN value.
Afterall Its a 2d polygon manipulation library.
phr00t
October 2, 2011, 12:59pm
18
@tralala2
What is the minimum image size this function supports? Let me know if you make any updates to your code so I can download them. Thanks again!
i dont know exactly > 32 pixels ? you can do a test drive by creating images from microsoft paint.
phr00t
October 2, 2011, 11:57pm
20