Let's say there is a 3D printer loading a facet with 3 vertexes and a normal:

$$ F: \begin{cases} \text{vertexes:}~~ (x_1,y_1,z_1),(x_2,y_2,z_2),(x_3,y_3,z_3) \\ \text{normal:}~~ (n_x,n_y,n_z) \end{cases} $$

When printing the facet at $z_h$ ($z$ of the printer header), the header should follow a line in the plane of

$$ S: \begin{cases} z=z_h \end{cases} $$

The result is a line segment starting from point $A$ to $B$.

$$ S ~\cap~F=\text{line_segment}(A,B) $$

I am looking for a method which obtains $A$ and $B$ explicitly.


1 Answer 1


Sort the vertices by $z$-coordinate. Some simple range checks will then tell you which edges intersect the plane for a given $z$-value, and the intersection points can be found by linear interpolation.

  • $\begingroup$ Looking for $A=..., B=...$ answer. $\endgroup$
    – ar2015
    Jan 19, 2018 at 3:21
  • $\begingroup$ @ar2015 Prroducing such a formula is junior-high, if not grade-school, level math. I encourage you to work the rest out for yourself. $\endgroup$
    – amd
    Jan 19, 2018 at 3:39
  • $\begingroup$ I do not care which grade it is. Looking for a false safe solution to implement on a 3D printer. $\endgroup$
    – ar2015
    Jan 19, 2018 at 4:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .