patmo141 / cut_mesh Goto Github PK
View Code? Open in Web Editor NEWTools for mesh trimming and cutting in Blender
Tools for mesh trimming and cutting in Blender
Currently, cutting engine will only cut a single edge into a face (eg...will not create new NGons). Need to improve cutting code to accommodate this scenario
"Shift +D" gives me the same result of "P" (Separates the region into a new obeject, leaving a hole in original mesh)
Sometimes while rotating/zooming during first phase of polytrim
i got this error message in console.
Traceback (most recent call last): File "/home/bartus/.config/blender/2.78/scripts/addons/cut_mesh/modaloperator.py", line 114, in draw_callback_postpixel self.draw_postpixel(context) File "/home/bartus/.config/blender/2.78/scripts/addons/cut_mesh/op_polytrim/polytrim_ui_draw.py", line 17, in draw_postpixel self.draw_2d(context) File "/home/bartus/.config/blender/2.78/scripts/addons/cut_mesh/op_polytrim/polytrim_ui_draw.py", line 24, in draw_2d self.knife.draw(context) File "/home/bartus/.config/blender/2.78/scripts/addons/cut_mesh/op_polytrim/polytrim_datastructure.py", line 1726, in draw common_drawing.draw_3d_points(context,self.pts, 4, color = (1,1,1,1)) File "/home/bartus/.config/blender/2.78/scripts/addons/cut_mesh/common_drawing.py", line 121, in draw_3d_points bgl.glVertex2f(*vector2d) TypeError: glVertex2f() argument after * must be an iterable, not NoneType
When the issue occurs viewport goes black, beside the blue knife line. Even the white way-point on the knife path gets hidden, and to bring everything back I have to zoom-out/rotate-back the view.
They could be cleaned up and organized
Somewhere, there is a failure in cutting that does not take into account rotation and location.
However it is odd that some segments succeed while others fail. The cutting alogorithm will actually try multiple methods, so perhaps there is transformation error in one but not the other.
Before applying transform (left) After applying transform (right)
The three lists in PolyLineKnife: pts, normals, and face_map all have data about the input points in the same order and position. Therefore combining them into one data structure would be helpful in condensing and organizing the code.
The data structure I have in mind is a list of dictionaries, each dictionary having three keys: "point", "normal", and "face_index". So if you wanted to access the seventh point's normal you would do point_data[6]["normal"] (first point is at index 0)
It would look something like this:
[ { "point" : (point vector goes here), "normal" : (normal vector goes here), "face_index ": 452},
{ "point" : (point vector goes here), "normal" : (normal vector goes here), "face_index ": 3},
{ "point" : (point vector goes here), "normal" : (normal vector goes here), "face_index ": 98} ]
Cutting should have modes which remove parts of mesh (destructive delete), separate parts of mesh (destructive cut into parts) or simply duplicate out the region (non destructive duplication)
Hi,
The tool looks great. I am currently doing exactly what's in your youtube video and the last step "press E" to do the final cut is not working. It does not create a separate mesh with the cut portion inside.
I added the blend file.
What do you think ? Thank you.
Alexandre
this would be nice
Hey Patmo,
The example you showed in the youtube video https://www.youtube.com/watch?v=nrGNMm3I2Eg is not working. Sorry to be so bland and I understand the frustration when users just complain about not working. :-)
I am using Blender 2.76b. Since there is no mention of the blender version to be used I assumed it to be 2.76 as bvhtree is now a package of blender 2.76b.
Providing certain details like Blender and other supporting module versions might really help. Also for the example of geodesic_walk I see that you are using a different method signature in the video from the original code. Any clues? Have you updated it?
Finally, is there a way I can be of some help?
Regards,
Instead of filtering stroke points in screen space, ray_cast them all onto the surface, then re-form the 3D stroke by evenly interpolating at a given point spacing.
replace stuff like below with a standard function call
if bversion() < '002.077.000':
loc, no, face_ind = self.cut_ob.ray_cast(imx * ray_origin, imx * ray_target)
else:
res, loc, no, face_ind = self.cut_ob.ray_cast(imx * ray_origin, imx * ray_target - imx * ray_origin)
Sometimes when making a non-manifold cut, the segment between the last two points is not drawn.
This issue is similar to issue #40
Messes up the trim line in many ways
Currently only Scroll Wheel and Middle Mouse events are handled allowing the user to navigation while placing the cut line.
Port over PolyStrips methods for testing self intersections in the user drawn poly line
Currently, after cut points are adjusted, the whole cut chain must be recalculated. Would be better to give user live feedback for this.
Need to update the modal code so we can pan around.
Dear Patmo141,
I'm trying do to Cut-Mesh works on Blender more than a year but I was not able. I test in Ubuntu and Windows, in a lot of versions, but simply doesnt run.
A think that I saw is that in your examples appear a green line when you click on C. In my case appear only some green points... without the cut line.
The message is always the same:
sketch confirmed
sketch too short, cant confirmBEGIN CUT ON POLYLINE
first face group index
(5287, [0])
final group not added to dictionary yet
(5302, [13])
FACE GROUPS
{5216: [6], 5347: [8], 5287: [0], 5213: [7], 5297: [12], 5275: [11], 5182: [3], 5302: [13], 5273: [10], 5210: [5], 4859: [1], 4860: [2], 5181: [4], 5278: [9]}
m, IND
(0, 0)
m, IND
(1, 1)
prev face prevented walking in the Verts0 direction
m, IND
(2, 2)
m, IND
(3, 3)
m, IND
(4, 4)
m, IND
(5, 5)
prev face prevented walking in the Verts1 direction
m, IND
(6, 6)
m, IND
(7, 7)
m, IND
(8, 8)
m, IND
(9, 9)
m, IND
(10, 10)
m, IND
(11, 11)
m, IND
(12, 12)
m, IND
(13, 13)
prev face prevented walking in the Verts0 direction
This is the loop closing segment. 2
left click modal inner
face selected!!
seed set
Can you tell something about this? I guess I'm doing something wrong, but I'm following the video and text you share on Youtube and GutHub.
Thank you for the attention!
Use bezier interpolation to make a smooth cutting curve that can be evaluated at a user specified point density for ultra smooth cutting
Dear patmo141,
First of all, congratz for your tools. These are great!
Second, I'm with a problem about Polytrim. I follow the videos and the tutorial on GitHub, but the addon simply doesnt works.
I have this output on terminal:
sketch confirmed
sketch too short, cant confirm
left click modal inner
face selected!!
seed set
But nothing happens at mesh.
May I did somthing wrong?
Thank you and a big hug!
currently ray casting twice to pick regular cut points vs those snapped to non manifold edges
It's difficult and not very streamlined.
As a pre-requisite to feature snapping, a 2d cross section preview showing creases and features when translating cut points should be displayed
Experiment with single points vs smooth sketching
Hi,
I'm super excited to see all this work you have been doing for cutting meshes! I'm working on a project using the blender api to automatically perform a series of splits to a mesh. For the most part I can use bmesh.ops.bisect_plane, but I need to do a curved cut as well.
Here is an image describing the operation:
The current strategy uses the blender boolean modifier to make the cut (really two operations to isolate the front and back). A 'cutting-mesh' is created that bridges the two cut-polylines. Unfortunately the boolean sometimes fails, and I'm not sure why! :(
It seems a custom operator that works with blender bmeshes directly is needed. Do you have any pointers for creating such an operation?
'D' actually changes the bmesh, which causes the seed face index to sometimes become different. Acutually referencing the BMFace instead of the index remedies this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.