zeffii / mesh_tiny_cad

a tiny set of unmissable CAD functions ( VTX, XALL ...) for Blender

Home Page:http://zeffii.github.io/mesh_tiny_cad/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: vertex at edge intersection from view

BloodyRain2k opened this issue · comments

The function to be able to create a vertex at the intersection of two edges is the primary reason why I'm glad this addon exists, but most of the time I'd need an intersection based on a viewing angle, not at the "closest" intersection of the edges.

It's a bit difficult to explain so have an image:
http://i.imgur.com/RUF0oE0.png

These two edges overlap on every viewing direction while never actually overlapping directly.
As the function works it does what it's meant to do and place a vertex at the point where they intersect, or in this case, the closest point.
That's good as that can have it's uses too, but I'd need it way more often to base that intersection on my current view.

So long explaination short, could an additional setting be added to the function that when toggled on uses the view's intersection for determinating where the intersection is?
Like when used from the right ortho view, have it put the vertex 2 gridunits up-right from the center where the intersection is when viewed that way.

That'd be really nice :3

yeah, this should be possible. no ETA.

I think i'd need to convert the two edges to 2d, get their 2d intersection, then transform that 2d coordinate back to 3d, and project a line between the viewing angle, through the new 3d point till it hits the rear edge.

btw, zip a blend contains those edges in the image and drag it into one of these posts. That way i can just load a blend and get cracking.

I won't do anything until you respond :)

so, stick a vertex where they visually intersect from a given 3dview. i'll see what can be done.

interestingly I think the Bisect tool offers most of what's being looked for here..

bpy.ops.mesh.bisect(
    plane_co=(-1.31, -5.76, 0.72),
    plane_no=(-0.62, 0.51, 0.58),
    xstart=71, xend=275, ystart=609, yend=486
)

you can select the edge you want to slice, then hit bisect, the drag the bisect line to trace the other edge..

  1. plane_no is probably the inverted viewing angle
  2. plane_co not sure how this is being decided, but either of the verts on the edge behind should suffice (i might be wrong)
  3. xstart/end ystart/end can be calculated by viewing matrix 3d->2d location..

Too bad that Bisect is that one tool in Blender that offers zero precision or snapping by default : (
Though atleast it offers limiting the cut to what's selected.