How to shrink a 3d plane in local direction

25 Views Asked by At

I have a 3d plane with known 3d coordinates (ABCD). I want to take 2 points, for example, AB and shrink towards CD (or CA to DB, etc), by not losing the slope.

What I have tried is:

NewA = normalize(C-A) * shrinkFacor (same for B). Not sure if the results are correct and if it's most robust method.

enter image description here

1

There are 1 best solutions below

2
On BEST ANSWER

If $ABCD$ is a parallelogram you can "move" $A$ and $B$ according to $A'=C+(1-\epsilon)(A-C)$ and $B'=D+(1-\epsilon)(B-D)$, where I use $A$, $B$, $C$ and $D$ as coordinate vectors and where $\epsilon$ is some real number with $\epsilon \in (0,1)$ (if you want to shrink the parallelogram).