Search in sources :

Example 1 with LineHeight

use of org.twak.viewTrace.facades.LineHeight in project chordatlas by twak.

the class SkelFootprint method findOcclusions.

private static void findOcclusions(HalfMesh2 mesh) {
    int count = 0;
    for (HalfFace hf : mesh.faces) for (HalfEdge e1 : hf.edges()) {
        Line el1 = e1.line();
        for (HalfFace hf2 : mesh.faces) {
            for (HalfEdge e2 : hf2.edges()) if (e1 != e2) {
                Line e2l = e2.line();
                if (el1.distance(e2l) < 1 && e2l.absAngle(el1) > Math.PI * 0.7) // !el1.isOnLeft(  e2l.fromPPram( 0.5 ) )
                {
                    ((SuperEdge) e1).occlusions.add(new LineHeight(el1.project(e2l.start, true), el1.project(e2l.end, true), 0, ((SuperFace) hf2).height));
                    count++;
                }
            }
        }
    }
    System.out.println("found " + count + " occluding surfaces");
}
Also used : Line(org.twak.utils.Line) SuperLine(org.twak.viewTrace.SuperLine) LineHeight(org.twak.viewTrace.facades.LineHeight) HalfEdge(org.twak.utils.geom.HalfMesh2.HalfEdge) HalfFace(org.twak.utils.geom.HalfMesh2.HalfFace) MFPoint(org.twak.tweed.gen.FeatureCache.MFPoint)

Aggregations

MFPoint (org.twak.tweed.gen.FeatureCache.MFPoint)1 Line (org.twak.utils.Line)1 HalfEdge (org.twak.utils.geom.HalfMesh2.HalfEdge)1 HalfFace (org.twak.utils.geom.HalfMesh2.HalfFace)1 SuperLine (org.twak.viewTrace.SuperLine)1 LineHeight (org.twak.viewTrace.facades.LineHeight)1