-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cross Section, Bisect nodes and objects. #1728
Comments
@Durman the node doesn't join the objects, but it does perform all matrix cuts on each incoming object. |
look at the code to understand why
|
it makes sense to add a toggle to use the above algorithm as "All matrices" vs a mode that does "individual matrices". |
I am reluctant to modify The cross section node too.. can't commit this just yet. |
i've committed this to Bisect node. |
I can look at the code but I can not understand nothing. My knowledge about Python too poor. |
@Durman ofcourse it can be done, but not with the current incarnation. Not sure what the interface should be for that (many options are possible). Maybe the most conventional is to take nested lists of Matrices...
a bool/toggle for "nested" would iterate over for idx, obj in enumerate(verts, faces):
for mat in matrices[idx]:
... make chops.. |
When I tested bisect node I supposed that nested list of matrix received right result, for this I used List split node, but it did not help me.)) |
only a few lines of code need to be added to do what you want @Durman - but i will think about it first before writing code. -- maybe tomorrow. |
as for nested Matrix lists.. by which means do you intend to produce them? the normal |
it's possible to give |
ok |
good work on solving your own problem! |
Yes, go ahead for more results. Can do! |
I have reconstructed Bisect node. I have changed input matrix on two vectors inputs, first for moving section plane second for rotation. Now it is possible to mange with section plane for each input object. '''
in vertices v
in edg_pols s
in move_matrix v d=[[(0,0,0)]] n=0
in rotate_matrix v d=[[(0,0,1)]] n=0
out verts_out v
out edges_out s
out polys_out s
'''
from mathutils import Vector
from sverchok.data_structure import Matrix_generate, Vector_generate, match_long_repeat
from sverchok.nodes.modifier_make.bisect import bisect
from sverchok.utils.sv_mesh_utils import mesh_join
def input_mat(io):
def check_len(data, io):
if len(data) > io: return io
else: return -1
return match_long_repeat([move_matrix[check_len(move_matrix, io)]] + [rotate_matrix[check_len(rotate_matrix, io)]])
verts_ob = Vector_generate(vertices)
for io,obj in enumerate(zip(verts_ob, edg_pols)):
ln_e,ln_p = 0,0
v_obj,e_obj,p_obj = [],[],[]
for i,p_mat in enumerate(zip(*input_mat(io))):
pp = Vector(p_mat[0])
pno = Vector(p_mat[1])
res = bisect(obj[0], obj[1], pp, pno, True, True, True)
v_obj.extend([res[0]])
e_obj.extend([res[1]])
p_obj.extend([res[2]])
v_obj,e_obj,p_obj = mesh_join(v_obj,e_obj,p_obj)
verts_out.append(v_obj)
edges_out.append(e_obj)
polys_out.append(p_obj) |
@Durman i think it is great that you have managed to solve this for yourself. That's what SNLite was made for.
|
I will think about this when time permits. |
@Durman , the delaunay node is located in the same file as 2dvoronoi ( https://github.com/nortikin/sverchok/blob/master/nodes/modifier_make/voronoi_2d.py ) |
Is it possible to cut objects individually? I think this nodes unite objects in one inside itself. It will be better if one matrix cut first object and two matrix cut second object, for me in my case.))
https://gist.github.com/8b592141eba2da47443ba4e0690fcf6a
The text was updated successfully, but these errors were encountered: