Abantech / Efficio

1 stars 1 forks source link

Determine method to efficiently draw irregular geometries #5

Closed GMelencio closed 7 years ago

GMelencio commented 7 years ago

I would like to determine a method for creating irregular 3D shapes "on the fly" so that this can be done quickly and easily by non-developers. When I say irregular I mean, anything from a rectangle with rounded corners to something out of Frank Gehry's imagination.

There are many solutions that exist for creating 3D shapes that don't conform to standard set geometric primitives (i.e. cube, sphere, cylinder, cone) - although these are typically limited simple methods for modifying the geometry - such as extruding, offset, or generating symmetrical shapes, along 2^n axes and then simply wrapping in a mesh.

There's the approach of vertex manipulation, but that gets dicey fast and imho, rarely user friendly: you may want to move just one vertex independently of the adjacent vertices, or have the other vertices "follow" the one you move but to a lesser degree (as if it were cloth), but you might also want to move an entire edge. So while it's the most flexible approach (pun intended). It's far from the easiest/most intuitive.

That leaves the last two that I am considering: 1) Defining a shape using "mini-voxels" and 2) using Boolean Constructive Solid Geometry operations

The idea with using mini-voxels is building the shape like one would do so with lego in the real world (or minecraft), except the voxels can be small enough to make the whole piece look like (think Anti-aliasing/muti-sampling).

The idea being that, in this way, it should be easier to cut/fillet/chamfer, slice, etc the object. However, I'm not sure how this would work for operations that scale or skew the entire parent 3D object. Another issue I see here is that the more complex the whole piece is, the more voxels would be required and it could be very memory intensive. We might be able to implement a "garbage collection" routine so that the "hidden" voxels are deleted and that might help a bit, but doing so have overhead in and of itself. One thought I had here is that, after the "whole piece" is created, we could try to detect the voxels that are on the "outside", create a vertex map based on their positions and use that to create the new geometry to replace the voxel-built mesh.

The other approach is using Boolean Constructive Solid Geometry operations. While this prevents the proliferation of meshes, it's a processing intensive task and not quite as easy to use. - You're limited to the shapes you want to cut out by the geometry primitives that you can use to "deduct" from the mesh. One can, however, use existing "irregularly shaped" geometries to perform irregular cuts, but I'm not sure that's the best way to go either.

Perhaps the 2 options I noted aren't the only options - maybe there are other options or an "hybrid" approach that can be applied. Or maybe these are good options and arguments can be made for one or the other. Maybe just simple modifications are needed.

theo-armour commented 7 years ago

image

Convex Geometry R1

@Abantech/core

Three.js Convex Geometry: Draws a mesh that encompasses all the given points. But does not cover areas of concavity.

GMelencio commented 7 years ago

@Theo-armour

Thanks! So if you want a geometry to act like "clay" as a reaction to the leap hand (shaped as it moves along. would we just introduce new vertices along the path (around the hand)? If it's so easy to do so, then i am curious as to why boolean operations are so processor intensive...

On Fri, Sep 23, 2016 at 3:40 AM Theo Armour notifications@github.com wrote:

[image: image] https://cloud.githubusercontent.com/assets/547626/18777825/1b576b92-8126-11e6-8d5c-1145b6cd17f9.png

Convex Geometry R1 http://jaanga.github.io/cookbook-threejs/examples/geometry/convex-geometry/convex-geometry-r1.html

@Abantech/core https://github.com/orgs/Abantech/teams/core

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Abantech/Efficio/issues/5#issuecomment-249124002, or mute the thread https://github.com/notifications/unsubscribe-auth/AEfoMUDGfo6GU4cSoGtQRxWBgInGpHbuks5qs4J3gaJpZM4KEf7h .

theo-armour commented 7 years ago

@GMelencio

So if you want a geometry to act like "clay" as a reaction to the leap hand (shaped as it moves along. would we just introduce new vertices along the path (around the hand)?

How about we keep geometry creation/editing/vertices and user interface/'hand' separate for the moment?

Probably more practical to discuss the former to begin with.

Let's call the thing that initiates changes in geometry the 'wand' or the 'marker', what might some of the basic rules be?

If it's so easy to do so, then i am curious as to why boolean operations are so processor intensive...

OK. let's imagine Boolean ( initial cap please) operations are not processor intensive. Then what?

GMelencio commented 7 years ago

Let's call the thing that initiates changes in geometry the 'wand' or the 'marker', what might some of the basic rules be?

I talked to Chris W about this at length - there are multiple ways to create /modify a geometry and I think in large part it depends on the application. I think at the very least we want to make sure that the geometry stays manifold. I think that the initiator of the change must be something that can cause the geometry to change in the same ways we'd expect in real-life; you can flatten, stretch, cut, carve, poke holes, "scoop out" a piece, chisel down, smooth out, etc. The difference being that instead of the subject object having a property on one value of the spectrum of physical properties (i.e, malleable vs brittle, soft vs hard) the operations we can carry out are not limited to one side. I.e. if it were the statue of David, I should be able to break off his nose with one tool, and then straighten his hair with another.

OK. let's imagine Boolean ( initial cap please) operations are not processor intensive. Then what?

Then we can use other geometries to perform the modifications that we want on the subject geometry, but continously. So let's say I wanted to take a plane (3D, basically a cube with a 1-5 px depth) and want to make it a 'stencil' I'd simply take a cylinder and carve out the "hole". (kinda like a lightsaber would do so against a piece of metal). Think about that for a second: if we were using boolean operations, that would require multiple boolean operations to occur - continuously as the user moves the "wand" across the geometry.

On Tue, Sep 27, 2016 at 3:18 AM Theo Armour notifications@github.com wrote:

So if you want a geometry to act like "clay" as a reaction to the leap hand (shaped as it moves along. would we just introduce new vertices along the path (around the hand)?

How about we keep geometry creation/editing/vertices and user interface/'hand' separate for the moment?

Probably more practical to discuss the former to begin with.

Let's call the thing that initiates changes in geometry the 'wand' or the 'marker', what might some of the basic rules be?

If it's so easy to do so, then i am curious as to why boolean operations are so processor intensive...

OK. let's imagine Boolean ( initial cap please) operations are not processor intensive. Then what?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Abantech/Efficio/issues/5#issuecomment-249785455, or mute the thread https://github.com/notifications/unsubscribe-auth/AEfoMYAtyrMNCPvx8LiZ5BTgfQzD3STTks5quMMrgaJpZM4KEf7h .

theo-armour commented 7 years ago

@GMelencio

There are already at least a dozen topics of interest here. And the dialog looks like being able to ad even more topics with each message.

Such a dialog is:

We must design a more effective and productive way of using GitHub, Git and their APIs. A way that facilitates the design of killer apps

Or we are really, really careful about identifying all the aspects in that column in the right of the issues pages

Boy, did I go off-topic on this one. ;-)

But

Unless we design our design process the design won't be a success.

GMelencio commented 7 years ago

@theo-armour I agree on all points.

Nonetheless, I feel we really need to stay on topic.

My suggestion: if you have answers/ideas to my previous post, then please indicate them as appropriate.

If it warrants the creation of another issue then (at least for now) - how about we simply indicate that we will tackle that in another issue reference it as a link to it from there. That way we might even be able to use Githb API to crawl through our issues and draw up an idea map. I think that's a good simple start.

But to get there we must all make efforts to be vigilant about staying on topic and create references where necessary.

Now, so I can get back to coding, do you have any questions or ideas directly relevant to the question posed in my original post and/or my response that we can add to this discussion? I just want to get us back on track here... I hope you understand.

theo-armour commented 7 years ago

@GMelencio

do you have any questions or ideas directly relevant to the question posed in my original post and/or my response that we can add to this discussion

I don't see a single question in your original post. ;-(

If your question relates to creating manifold irregular 3D meshes, then I provided you with an initial solution.

If your question relates to editing 3D meshes then perhaps this could kick-off an investigation

download

Mesh Edit 2.0

GMelencio commented 7 years ago

@Theo-Armour

My question relates to editing 3D meshes in a manner that happens continuously - either adding or subtracting top the mesh. Hopefully with the mesh staying manifold the whole time but we can skip that "manifold" requirement for the initial version.

So back to my example, how would one go about carving out holes in a semi-flat plane - the real-life metaphor being a welder using a plasma cutter to turn a metal plate into a stencil. How do we do this in 3D efficiently? a boolean operation with every movement seems a bit expensive.

Greg Melencio CEO and Founder Abantech LLC 571-402-4688

On Thu, Sep 29, 2016 at 12:48 AM, Theo Armour notifications@github.com wrote:

@GMelencio https://github.com/GMelencio

do you have any questions or ideas directly relevant to the question posed in my original post and/or my response that we can add to this discussion

I don't see a single question in your original post. ;-(

If your question relates to creating manifold irregular 3D meshes, then I provided you with an initial solution.

If your question relates to editing 3D meshes then perhaps this could kick-off an investigation

[image: image] https://cloud.githubusercontent.com/assets/547626/18941342/300b13a6-85c5-11e6-88c5-35e4d7c26c53.png

Mesh Edit 2.0 http://jaanga.github.io/cookbook-threejs/examples/editing/edit-mesh/r1/edit-mesh-r2.html

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Abantech/Efficio/issues/5#issuecomment-250369438, or mute the thread https://github.com/notifications/unsubscribe-auth/AEfoMRLRba2tjXtE6hGQJsVUI5ky-8_Lks5qu0MNgaJpZM4KEf7h .

theo-armour commented 7 years ago

@GMelencio

So back to my example,

Ha ha. Don't you mean your question that had no question?

One day, you will learn to phrase stuff clearly and concisely.

how would one go about carving out holes in a semi-flat plane

What is difference between semi-flat plane and semi-unflat plane?

Recording diameter and position of holes is not that difficilt

Showing holes visually - might use thousands if particles to simulate the surface of a mesh

Calculating outlines of comingled holes: a bugger

GMelencio commented 7 years ago

I'm sorry, I must confess I don't understand the response here:

What is difference between semi-flat plane and semi-unflat plane?

I'm simply saying the mesh to be modified is 3D, not 2D.

Showing holes visually - might use thousands if particles to simulate the

surface of a mesh

So is this analogous to the concept I had of "micro-voxels" that is, there isn't really a mesh there, just something that LOOKS like a mesh, and the corresponding particles are added or removed based on the operation that takes place? Is that more efficient than boolean operations?

After we make the modifications, to the mesh made out of particles, can we then determine where the vertices ought to be and then create a mesh from there? If so HOLY COW - that would be a brilliant solution.

Any chance you could create a small demo of a small 10 x 10 x 2 cube that is made up of particles where the particles that are "touched" disappear?

Greg Melencio CEO and Founder Abantech LLC 571-402-4688

On Sun, Oct 2, 2016 at 5:05 AM, Theo Armour notifications@github.com wrote:

@GMelencio https://github.com/GMelencio

So back to my example,

Ha ha. Don't you mean your question that had no question?

One day, you will learn to phrase stuff clearly and concisely.

how would one go about carving out holes in a semi-flat plane

What is difference between semi-flat plane and semi-unflat plane?

Recording diameter and position of holes is not that difficilt

Showing holes visually - might use thousands if particles to simulate the surface of a mesh

Calculating outlines of comingled holes: a bugger

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Abantech/Efficio/issues/5#issuecomment-250961500, or mute the thread https://github.com/notifications/unsubscribe-auth/AEfoMWRDfkcrSPbB9CRao23hPI_9Oh9Cks5qv3PmgaJpZM4KEf7h .

theo-armour commented 7 years ago

@GMelencio

https://threejs.org/examples/#webgl_nearestneighbour

Using your cursor, move into the the filed of sprites.

Notice that the sprites that you approach change color from brown to read

Without too much difficulty the sprites could be made to disappear, lie on a flat plane, or wavy plane or whatever.

GMelencio commented 7 years ago

@Theo-Armour

Stick a fork in it! This issue is closed!!! The two solutions you proposed yield the answer!!! We staret with sprites (what I was referring to as "micro voxels") and "mold" irregular geometries using them. Then after the user says he/she is "done" we simply figure out the vertices that are enveloped by the mass of voxels/sprites.

Bingo!!! THANK YOU!!!

On Thu, Oct 6, 2016 at 1:52 AM Theo Armour notifications@github.com wrote:

https://threejs.org/examples/#webgl_nearestneighbour

Using your cursor, move into the the filed of sprites.

Notice that the sprites that you approach change color from brown to read

Without too much difficulty the sprites could be made to disappear, lie on a flat plane, or wavy plane or whatever.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Abantech/Efficio/issues/5#issuecomment-251873235, or mute the thread https://github.com/notifications/unsubscribe-auth/AEfoMQ9RI44rQtELld5ZHggZr3n9arktks5qxIyrgaJpZM4KEf7h .

theo-armour commented 7 years ago

Closing is good