Extract vectors and vector cross-product

I’m trying to create an automation to extrude and slice window frames.

I have part of the procedure done (the easy part), but I got stuck now on getting the diagonal between the edges to create a slicing plane. My idea is to get the 2 tangent vectors coming from each vertex of the frame, and extract a cross-product vector that will be my guide to create a slicing plane. This should work for windows with 90° corners or with arches:

I’m working with a rectangle for now, and what I did was:

  1. Get the edges
  2. Evaluate curve at the edges
  3. Get the tangents

But I’ve been able to get a vector from the edge starting point towards endpoint, and I can’t figure out how to get the other vector:

I’ve been burning my brain for some time now. Any help?

Flip the curve - then your tangent will be facing the other way

Was just trying that now. Seems it will work… Thanks :grinning_face_with_smiling_eyes:

I mean, somebody has to have a C# / Python script kicking around for this, right?


Extract vectors and vector cross-product VR 01.gh (43.0 KB)

Works for single curves. For a set of curves, you’d have to feed the definition to a loop.

Hey, thanks a lot. I arrived to the solution with a similar (but much less refined) idea. I’ll study yours to see how can I improve mine. Thanks again!