import type { Attribs } from "@thi.ng/geom-api" ; import type { ReadonlyVec , Vec } from "@thi.ng/vectors" ; import { dot3 } from "@thi.ng/vectors/dot" ; import { normalize } from "@thi.ng/vectors/normalize" ; import { orthoNormal3 } from "@thi.ng/vectors/ortho-normal" ; import { Plane } from "./api/plane.js" ; export const plane = ( normal , w , attribs ? ) => new Plane ( normalize ( null , normal ) , w , attribs ) ; export const planeWithPoint = ( normal , p , attribs ? ) => { normal = normalize ( null , normal ) ; return new Plane ( normal , dot3 ( normal , p ) , attribs ) ; } ; export const planeFrom3Points = ( a , b , c , attribs ? ) => planeWithPoint ( orthoNormal3 ( [ ] , a , b , c ) , a , attribs ) ;