Hi,
How to Intercept the boundary between two points of a polygon(polygon includes broken line)?
My polygon is made by THREE.Shape and THREE. ExtrudeGeometry.
Can you give me such case?
Thanks in advance for your help!
This picture is what i what:
redline is polygon’s boundary, blue line is our need.
this will require storing the original polyline that generated the extruded shape such that points on the geometry can be mapped back to the original line. then it’s a matter of clipping the original polyline at the specified points and re-generating the extrusion.
using the raycaster class in threejs, you can find the face that was clicked and the mesh it was attached to. from there you can find the polyline segment that was clicked and interpolate from the end of the segment where it was clicked (if it was not on a point/node). then it’s a matter of cutting the polyline using two clicked points (and interpolation), creating a new polyline, and re-generating the extruded shape.