Booleans

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Booleans

Postby Bird » Fri Jun 22, 2012 8:17 am

I'm excited to see the new work on the Newton CSG operations.
I've already got a plugin up and running to test them when they're ready.http://www.hurleyworks.com/media/flash/NewtonBoolean/NewtonBoolean.html

I hope they're going to be *really* fast. :)

-Bird
Bird
 
Posts: 623
Joined: Tue Nov 22, 2011 1:27 am

Re: Booleans

Postby Julio Jerez » Fri Jun 22, 2012 8:36 am

Yes I am glad you are following.
I have the Boolean before bout it was base on solid BSP clipping.
The problem with BSP based CSG is that it does not scale well will large scale meshed.

Surface intersection trimming based Booleans, ha the problem that it is not volumetric, like solid BSP however is far more robust.
The truth is that in year and year of using my tool I have never came across anyone ether really needed a solid Boolean operation.
Surface clipping Boolean can work on open meshes, is more stable and it is localized, meaning that you can apply to unlimited side mesh and the cost is linear with the mesh size.
whish mean they can be use in real time in a high end editor. The operations are also of extreme high quality.
I am almost ready, and after I get the prototype I will make the demos. maybe this Saturday.

The Boolean operator was the last thing that stopping me for completing the advance mesh destruction demo. By advance I mean irregular size meshes, that can be destroyed in stages, large medium and small chunks.
Large and medium chunk are also destroyable into smaller chunks.
It will also support special features like wood splinter, and hollow mesh (example a columns with a plaster layer, and inside a concrete and further inside steel stud).
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Booleans

Postby Bird » Fri Jun 22, 2012 9:48 am

Excellent! I can't wait for this! :)

I think I may have asked you this before, but will we be able to use Newton's thread pool to do multiple Boolean operations in parallel? For example, if a mesh is shattered into 1000 voronoi cells, each cell clipping operation would be handled by the thread pool using NewtonDispachThreadJob().

-Bird
Bird
 
Posts: 623
Joined: Tue Nov 22, 2011 1:27 am

Re: Booleans

Postby Julio Jerez » Fri Jun 22, 2012 9:49 am

Yes. thats, the idea
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Booleans

Postby JoeJ » Fri Jun 22, 2012 12:37 pm

Hey, that's great! I planned to create an editor based on low-polygon open meshes, where i use the low-polys for hidden surface removal and procedurally generate more detailed geometry from it...
It seems most difficult work for that is allready done! :D
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Booleans

Postby Julio Jerez » Fri Jun 22, 2012 1:16 pm

why not joint fiorces and work in one editopr.
That is very much along the line of what I am doing already.
has you check newtonModelEditor in the SVN download.

this project is an editor for modeling physics and geometries.
The idea is not to subtitute anythingg like Max, Maya, or XSI.
but those editor are expensive for the most newton users, beside they do not provide eassy interface for physics modeling.
nor it is to make a Game editor.

bascially the idea is authoring tool for meshes and in some way using solid modeling similar editor like Unreal, Quake use to do.
also appling Marterial, and shaders, maybe the future a Node based shader language, and a node based animation system, and a node base AI system.
All in a unified formal.

and example would be something like this:
Say you have a level mesj of a nice buidling. In eth newton demos say it the Sibernic catedral.

That buildding has lof of column, beneche world, etc that are in fact instances.

To author that mesh in the editor you load the mesk
say we wnat to make teh each collumn a destritibel objects.

we find a columun and we delete each oteh column that is a replicat of teh foirst column.
then we applin some modiffioe that make say three scale version of teh same colime (like a rusian rag doll ragdoll)
we apply different material to each layer
we apply teh vorroain/ bollean cliipper to each layer,
we make a hierachilcal layers mesh.
we conver the mesh to an destructible collsion instance.
we place and instace of the mesh effect where there was a collum in the mode.
we same as a .ngd or with any oeteh format usin a plug in.
and then we use it.

we can do teh same wih benches but thi time we use a wood splinter for the voronoi decompose
all those thing are diffcult to put toghether using a plugin for a model editor like max.

The biggest problem that slow me down is coding the User interface.
but if a few peopel joint teh prlject that we can make more progeress more quicklly.

The tools in newton are very good, but ther do no have much exposure.
they are far superior thet we you find in engine like Havok and Phys, believe me.
the difference is that Intel and nvidea and amd hire large team of people to work on tools.

I already make some progree in the editor, It has general undo/redo navegation.
check it out.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Booleans

Postby JoeJ » Fri Jun 22, 2012 5:36 pm

Maybe i could be helpfull there, i've some experience with creating polygon model editors, like the catmull clark thing in the screen shot - feels freeform like modo, but with editable construction history like XSI, and the first symmetry on the planet that really works :) So far i have never really used it for anything.

Some negative vibes: If I look at the number of responces to your announcement of the new editor (...zero), maybe there is small interrest for it?
To be true, I'm one of those who think: A new newton editor? Nice - but will i use it - no.
Why? If i can't affort 3DSMax i can use Blender for modelling. To assemble the game world i need to create my own editor specialized to my engine - no way around that. Any Physics modelling will be done there.

But that's just my opinion - it would be really good to hear what other people think!!! :?: :?: :?:

Julio, what's your primary motivation?
Having a sandbox to show and test the capabilities of your engine or giving indies a universal tool?


I looked at the editor: Importing assets and camera navigation works, but no transformation of objects yet?
I wanted to look at the sources (svn), but there is a compiling problem with your xcopy Post-Build Event, translated: Path not valid, 0 files copied.
Is this something you need to fix?

Code: Select all
1>------ Build started: Project: pthread, Configuration: Debug Win32 ------
1>Compiling...
1>pthread.c
1>Creating library...
1>Build log was saved at "file://c:\dev\newton-dynamics-read-only\packages\thirdParty\pthreads.2\Win32\pthread\Debug\BuildLog.htm"
1>pthread - 0 error(s), 0 warning(s)
2>------ Build started: Project: newton, Configuration: debugDll Win32 ------
2>Linking...
2>LINK : Win32/newton/debugDll\newton_d.dll not found or not built by the last incremental link; performing full link
2>   Creating library Win32/newton/debugDll/newton_d.lib and object Win32/newton/debugDll/newton_d.exp
2>Embedding manifest...
2>Performing Post-Build Event...
2>Ungültiger Pfad
2>0 Datei(en) kopiert
2>Project : error PRJ0019: A tool returned an error code from "Performing Post-Build Event..."
2>Build log was saved at "file://c:\dev\newton-dynamics-read-only\coreLibrary_300\projects\windows\project_vs2008\Win32\newton\debugDll\BuildLog.htm"
2>newton - 1 error(s), 0 warning(s)


Editor.jpg
Editor.jpg (209.3 KiB) Viewed 11658 times
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Booleans

Postby Bird » Mon Jun 25, 2012 9:41 am

Looks like you made some nice progress over the weekend! :)

I made a little test to check if surface transfer is working correctly ( no uv yet ) and it worked fine. http://www.hurleyworks.com/media/flash/ChopShop1/ChopShop1.html

One problem I found was the the result mesh is composed of triangles that are not connected ... they each have their own vertices that are coincident with other face vertices. Is merging coincident points something that Newton will be handling or will we need to do it ourselves?

-Bird
Bird
 
Posts: 623
Joined: Tue Nov 22, 2011 1:27 am

Re: Booleans

Postby Julio Jerez » Mon Jun 25, 2012 9:57 am

They are supposed to be all conetecd, I will make a tes to see if that is the case. thre result soudl be a complete clean unified mesh.

how can you demostrate that ther face are disconected.

anyway I still have soem more work to do, teh core rely on thre low level funtion edge-plane inteserstion, edge- edge intesetion , and edge vertex intesection
I have no impelneted the last yet, I will do it this weed.

then the last function is the mesh regeneration which now is a naive contruintion of a polyginal soup, but the final one will actually preserve the topologies of the orignal mesh.
It is possible that the naive merge regeneration is what causes the disjoint vertices.

In the mean time you, can call this function after the operations NewtonMeshPolygonize (mesh) and it will clean up the result
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Booleans

Postby Bird » Mon Jun 25, 2012 10:30 am

In the mean time you, can call these function after the operations NewtonMeshPolygonize (mesh) and it will clean up the result

That didn't have any effect ... the result faces are still disconnected.

how can you demostrate that ther face are disconected.

The simplest test I made was a Boolean difference with 2 tetrahedron meshes. The result should have 8 vertices.

Calling NewtonMeshGetVertexCount(resultMesh) returns 8, but calling NewtonMeshGetPointCount (resultMesh) returns 11.
and I'm retrieving the geometry data from the result NewtonMesh using this code that I got from the Newton SDK DemoMesh class.

Would like a export a scene for you to look at?

-Bird

Code: Select all
int vertexCount = NewtonMeshGetPointCount (newtonMesh);
vertices = new dFloat[3 * vertexCount];
normals = new dFloat[3 * vertexCount];
uvs = new dFloat[2 * vertexCount];
memset (uvs, 0, 2 * vertexCount * sizeof (dFloat));

NewtonMeshGetVertexStreams (newtonMesh, 3 * sizeof (dFloat), (dFloat*) vertices, 3 * sizeof (dFloat), (dFloat*) normals,
                        2 * sizeof (dFloat), (dFloat*) uvs, 2 * sizeof (dFloat), (dFloat*) uvs);
Bird
 
Posts: 623
Joined: Tue Nov 22, 2011 1:27 am

Re: Booleans

Postby Julio Jerez » Mon Jun 25, 2012 10:48 am

Oh I see you are usin the funtion NewtonMeshGetVertexStreams stream whi is made for GPU rendering.
for a model editor you need to use the assesor fiuntion when give you asset to the wingedge structute.
you can see thet the vertex count is 8, but some of thso vetice are duplicated, thsi si for more efficenct in rendering

I can provide a will give you a better function for that shre the vertice and and preserve everythog else. teh dgMesgEffet is very vefry flexibel and poweful.

can you provide me with a array of teh format for say a cube in lighwayve.
the cude will have unique UV and materil per face, unique norlams perr c\vertex, but it sodul share teh verices.


how would you create teh veterx list index list for a mesh like that in lighwave. That will sove the imidiate problem.

I have a similar problem in the sanboxDemo because teh mesh that I see is the output of NewtonMeshGetVertexStreams, this si why I am making teh model editor that allow me to ispect the real data in eh newton data structure.

I will spend this week finishing up the bollean operators, then I will move to make the voroni destruction demos. which rely on the bollean and teh delaniy tetrahedralizatotr but for that they have to be very robust.
and then I will go back to the editor, to add that functionality.

my objective there is to see if I can author a complex mesh and and exported so that anyone can use it as a generic destruction object that can be instanciated several time reusing data.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Booleans

Postby Bird » Tue Jun 26, 2012 8:09 am

how would you create teh veterx list index list for a mesh like that in lighwave. That will sove the imidiate problem.

That's a good question. :)

One problem is that LW uses a more general concept of "VertexMaps" where a uv map is just one of many types that a user can create. Some vertex maps have 2 dimensions, like uv, but others can be of 1, 3 or 4 dimensions. A robust LW plugin *must* be able to support all vertex map types, not just uv's.

I'm not sure how the boolean algorithm works but I assume at some point you must create new vertices within an existing triangle and use the barycentric coordinates of that point to compute it's new interpolated uv values. If that's the case, maybe the easiest thing would be for you to provide a Newton function that allowed clients to obtain a array of the new vertices that the boolean operation generated, along with the face ID of the original triangle that they were created in and the new vertex's barycentric coordinates with respect to that original triangle. That way clients could take that information and generate the interpolated values themselves for each vertex map that the LW user has applied to the original triangle's vertices.

Does that make sense to you?

Here's a link to the latest LW SDK if you would like to take a look at it.
http://c3433340.r40.cf0.rackcdn.com/LIghtWave_11_0_SDK.zip

-Bird
Bird
 
Posts: 623
Joined: Tue Nov 22, 2011 1:27 am

Re: Booleans

Postby Julio Jerez » Tue Jun 26, 2012 11:04 am

Ha ok.
I openened with VS but it fail, it seem it requred lot of stuff form lighwave. but That's ok I do not need it

I open teh doc and browse ove looking of soem get stared and I foudn this

Let's Make a Box
Author Ernie Wright
Date 29 May 2001

This is an introductory level plug-in tutorial. We'll be discussing a Modeler plug-in that makes a box. The emphasis in this first installment is on the basic mechanics of writing and compiling a plug-in. We don't want to get bogged down in the specifics of creating geometry, so we'll make a simple shape, and we'll do it in the simplest available way, using the MAKEBOX command. But don't worry, we'll get to some of the cool stuff in later installments.

Our First Box Plug-in

before I read it, can you tell me if this sufficient for make a mesh?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Booleans

Postby Bird » Tue Jun 26, 2012 11:23 am

before I read it, can you tell me if this sufficient for make a mesh?

Yes. Part 3 and Part 4 are worth looking at. The MeshEditOp is the struct that I use to create geometry in my LW plugin.

There's also some useful info in the "File Formats" ->Objects section.

A good example to look at to see how to extract the geometry data in LightWave is the "scenescan" plugin. It's in the samples/Layout/Generic/ folder.

If you want to complie and run the plugin in LightWave, there's a free LW 11 trial version you could download at http://www.newtek.com/products/lightwave/lightwave-downloads.html. Any plugin you load should still work in the trial version.

If you need any kind of help please let me know.

-Brid
Bird
 
Posts: 623
Joined: Tue Nov 22, 2011 1:27 am

Re: Booleans

Postby Julio Jerez » Tue Jun 26, 2012 12:11 pm

Ha i see, I believe I have all the information I need from part 3 "A Mesh Edit Box"

what I will do is I will write a utility function that will create a VertexList index list mesh just liek is ecplain in part 3, you can use it to build data for you plugin.
It have to be later tonight have to go to work now.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 16 guests