JacquesLucke / animation_nodes

Node based visual scripting system designed for motion graphics in Blender.
Other
2.28k stars 342 forks source link

add new set of geometry tools #430

Closed og76 closed 4 years ago

og76 commented 8 years ago

I have tackled this for a while now and should start adding some

For this, I think we need a dedicated folder/menu/category called geometry It contains ops that are not quite vector, not quite mesh stuff and so on, so I see it as a separate thing. For example the vector nodes are somewhat more basic than these

Also, the recent distance to edge/plane are already part of it in a slightly different way

JacquesLucke commented 8 years ago

I think we should make the new category now, but making more nodes for these category can be done later, because adding nodes doesn't break existing files etc.

og76 commented 8 years ago

the only break can be in the recent distance to line/plane that is redundant to my project point on line/plane . others indeed are no break

that also gives the location and a factor/parameter that is needed in some cases (just like the nearest bvh also gives not just distance)

also using another mathutils geometry for the edge also, I wanna use edge as name elsewhere, when I actually use edge (socket ..) not any line ..

coming soon with these two and couple more related, like matrix to plane point/nor and inverse, or maybe, others, in time

og76 commented 8 years ago

sorry, please see #431 , not the above link in my branches

added geometry folder (+ init)

adding:

as sometimes it's easier to refer to object matrix instead of point/normal, while point/normal is gonna be used everywhere to define a plane (cheaper). I avoid having this as option inside node, as it will repeat in many nodes

should remove :

examples:

project point on line project point on plane

og76 commented 8 years ago

this also needs dedicated menu (and some more stuff in time)

428

og76 commented 8 years ago

I will add more to this.

But I just realized that I forgot to remove the distance to line/plane nodes (redundant) I did change the vector menu to point to the Project... nodes and the proj nodes do have search tags Distance to ..

Even so, I should have removed the redundant :(. But now the version is out ... now what?

JacquesLucke commented 8 years ago

I'm not at the pc now, but I think I removed these redundant nodes

og76 commented 8 years ago

true . sorry, my bad ... :)

I'll keep posting here the new geometry nodes, separate issues only if the case ..

og76 commented 8 years ago

For further geometry nodes, for v1.51 or so.

Please take a look here https://github.com/og76/animation_nodes/tree/geometry-intersections/nodes/geometry

New stuff with respective questions are:

Now generally:

otherwise they are fully workin, tested such for quite a while now, and may give examples of use

JacquesLucke commented 8 years ago

Could you make an example where the barycentric transform node is useful? Sorry, I don't really know what this is yet.

For the others: Yes I think we can implement them. Not sure where they will be useful but we don't have anything to loose here. I wonder if it would be better/cleaner to just use a combination of the getExecutionCode function and real functions like in this node: https://github.com/JacquesLucke/animation_nodes/blob/master/nodes/mesh/mesh_object_output.py#L85-L92

Putting everything into 'indirect code' is maybe faster but the speed gain is negligible if you have so many lines. The readability of the code is more important here.

og76 commented 8 years ago

actually the barycentric is a very interesting transform tool (transform vector) it works as an adaptive for triangles. and only requires 3 points, no other data ;)

This is why I ask if I should do a list version already, cause that is the way, not for one point However, it will not replace the adaptive as is more directed to 2,5D tricks. afaik, it is used for UVs and other mesh 2d-ish data, or could be used for mesh deform (using a mesh as lattice to deform another)

I'll make an example of that later. Now I'm concerned of how to implement right..

example basic, source tri to target tri, deform a cube barycentric

used in a loop as adaptive for tris. I'll work later on a more serious version, but this is why a list would do too. barycentric adaptive tris

ps. in comparison to quad adaptive:

og76 commented 8 years ago

for the others I'll make examples later.

just to give you an idea, on the polyline/plane special case, some basic examples

using as edges (actually I'll make a poly too) to make points out of a section (somebody asked this a while ago) edge sectioning

or cuttin the polygons and makin splines spline sections

or sample a spline and cut the "polyline" with some planes and make splines of it hatch1

YorsLosilla commented 8 years ago

That's really cool. New things to learn

-----Mensaje original----- De: "og76" notifications@github.com Enviado: ‎31/‎03/‎2016 10:57 Para: "JacquesLucke/animation_nodes" animation_nodes@noreply.github.com Asunto: Re: [JacquesLucke/animation_nodes] add new set of geometry tools(#430)

for the others I'll make examples later. just to give you an idea, on the polyline/plane special case, some basic examples using as edges (actually I'll make a poly too) to make points out of a section (somebody asked this a while ago)

or cuttin the polygons and makin splines

or sample a spline and cut the "polyline" with some planes and make splines of it

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub

og76 commented 8 years ago

just the tip of the isceberg..

on the functions / algo case, I'm never sure how to approach this

The self.fuction in the mesh example goes for some, and I kinda like it more than "abstract" code lines

but where you have lots of options getCode is skippin a lot of "if" , like if useDegree just adds some lines or not the dir to rot is a good example as it normally skip lots of lines in the pivot, cause I choose from the start ZX. so all that part is gone in the final script

hm

og76 commented 8 years ago

just added pulls for intersections intersecting lines planes sphere like this: (a special one for polyline plane)

528

int line line

529

int line plane

530

int line sphere

A special one here. Initially this was meant to be able to evaluate a spline/ or polyline on a world axis, as we cannpt do this today (we can project or eval by factor but not as world X)

531

int polyline plane more examples can be given here..

532

int plane plane

533

int sphere plane

534

int sphere sphere

og76 commented 8 years ago

also added barycentric transform, normal and triangulate (tesselate) #535 #536 #537 like this:

an idea about barycentric barycentric01

some normal stuff normal normal2

the (big) triangulator / tesselator with all options tesselate

Note on tesselate / triangulate (outside bmesh, that has it's own thing and faster than all)

I would have used the only the simple variant, no ngon etc as it is 2x to 5x faster , but is unpredictable in flipping the indices/normal in a way i cannot figure, so I leave the others too

The case where it goes flip is actually the very polygon indices / mesh data / polygons list, the very listish ones. hm

(I may have another formula later, as I have looked deeper into delaunay formulas and such, but we'll see)

YorsLosilla commented 8 years ago

I´m really excited about this new nodes. One of the few things that AN lacks is recursiveness and ways to implement some sort of simulated behaviours, where elements are aware of other elements conditions an react based on changes on such conditions. Some sort of IA. This is partially due to the limited recursiveness of loops and their deterministic approach.

However it seems that with these new nodes we will be able to implement more complex rules of behaviour to objects. Needless to say that it will take time to explore all the possibilities.

As you mentioned before this is just the tip of the iceberg.

Great job o.g. Congratulations new widgets have been added to swiss knife.

JacquesLucke commented 8 years ago

@og76 can you also write the release notes for these new nodes? Please try to keep it short :D I guess you can put all into one section: "New Geometry Nodes" or so

og76 commented 8 years ago

bit later. guess more or less using the above examples? maybe not all guess I could rather point to doc pages and just add more there ..

og76 commented 8 years ago

oh, and also I'll put stuff into menu, for this and other missing..

JacquesLucke commented 8 years ago

yes, you can also write the node descriptions into the node-docs and link there... (not sure how linking works though -.-)

og76 commented 8 years ago

ok. guess there is still

535 barycentric,

536 normal,

537 triangulate/tesselate

and #533 intx sphere plane, #534 intx sphere sphere

whenever u have the time :) I actually made the small changes since the others, but workin on desktop git, I guess I somehow I've not synced or so..

JacquesLucke commented 8 years ago

Yes I'll check them a bit later. Have to do some homework atm... Learning about cpu modes hehe: http://blog.codinghorror.com/understanding-user-and-kernel-mode/ :D

I guess I can merge these last few pull requests soon when you updated them (haven't checked today if you already did) :)

og76 commented 8 years ago

done

ps: see this cpu too :D http://www.wired.com/2016/05/ibm-letting-anyone-play-quantum-computer/

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.