Question

I'm in a tough moment in my project and not sure how to advance any further:
I have identified an object in a photo using openCV and I want to add depth to it - doesn't matter real world measurements at the moment.
I want to add depth in order to send the constructed shape to a 3D printer afterwards.
Is there anyway to do so in Android using opencv? Once again, this is not 3D reconstruction - I have one photo and I just want to give depth to the object, something like this:

give depth to a 2D shape

I thought to do so by putting the same 2D shape over itself several times and it'll give the "depth"..
Any suggestions? Libraries I should use?

Was it helpful?

Solution

Two connected aspects here: how you represent your 2D image and therefore how you intend to extrude it to 3D and then, how you plan to write out your 3D model for the 3D printer. The latter I presume you will want as an STL file.

There doesn't seem to be a lot around in terms of writing STL files direct from Android/Java but http://www.printingin3d.eu/javascad looks promising. I've not used the library or done any 3d printing to be honest but I understand there may be some rules around how you structure your object on ensure it can be 'sliced' properly when printing. This might therefore influence how you structure your 2D object.

So back to the extruding - how do you hold your 2D object; is it a series of (x,y) points? If so, then one approach is to split your polygon in triangles (ie. create a mesh) and then convert these into 3D objects by elongating the z axis to get a series of prisms. You can then add all these objects to a set and write these out as an STL file using javascad.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top