chsh2 / nijiGPen

An add-on of Blender focusing on Grease Pencil
GNU General Public License v3.0
220 stars 9 forks source link

feature request : delete line intersection #14

Open Ulf3000 opened 1 year ago

Ulf3000 commented 1 year ago

Hi your addon is really great. It helps alot for creating fills and silhuette/shapes in general.

i wanted to ask if your algorithms could recreate the intersection eraser from clip studio paint

https://user-images.githubusercontent.com/10765339/219900961-c8b49aa4-10a0-4fef-8463-240ed0f1c022.mp4

heres a demo video , its an eraser tool which can automatically detect intersections of lines and lets you erase just that section of the line with great ease and precision.

chsh2 commented 1 year ago

image

Blender has a cutter tool in Draw mode that has similar functionality to Clip Studio Paint's eraser.

I also tried to use a different method for this problem. In the new version (v0.3.3) there is a new operator "Pinch Together" which can eliminate small overlaps or gaps of selected strokes by slightly moving them.

Ulf3000 commented 1 year ago

ohh damn its right there , sometimes im blind. i expected this tool under the eraser and never used the cutter before. its not perfect like clipstudios but good enough.


the pinch together tool is good for merging strokes into one and corners , but doesnt really work if lines cross in the middle of a stroke, thats would be awesome if it stretched to the crossing.

also the transform is distributed through the whole stroke, a whole outline of a characters face could shift in the process, it would be amazing if the pich together tool would use a smooth falloff through the stroke.

amazing addon man! really outstanding.

Ulf3000 commented 1 year ago

Hey man, i want to detect the line crossings like the cutter and segment selection in edit mode do. is there any internal function for it which i can use ? or do i need to write one from scratch ?

chsh2 commented 1 year ago

Hey man, i want to detect the line crossings like the cutter and segment selection in edit mode do. is there any internal function for it which i can use ? or do i need to write one from scratch ?

There is a function mathutils.geometry.intersect_line_line_2d that judges if two line segments intersect with each other. But I do not find higher-level functions, e.g., getting the crossing of two GPencil strokes directly.

I am improving my pinch operator according to your feedback. However, I do not know how to improve the Blender's built-in tools such as the eraser and cutter without changing the source code.