@avdl/martinez
Version:
TypeScript library for polygon boolean operations
38 lines • 1.32 kB
TypeScript
/**
* Direct TypeScript translation of the Martinez C++ implementation
* Based on martinez.h and martinez.cpp from the example folder
*/
import { Polygon } from "./types";
/**
* Martinez Boolean Operations Algorithm
* Implements the Martinez-Rueda clipping algorithm for polygon boolean operations
*/
export declare class Martinez {
private eventQueue;
private eventStorage;
private subjectPolygon;
private clippingPolygon;
private intersectionCount;
/**
* Constructor
* @param subjectPolygon First input polygon
* @param clippingPolygon Second input polygon
*/
constructor(subjectPolygon: Polygon, clippingPolygon: Polygon);
/**
* Get the number of intersections found during computation (for statistics)
* @returns Number of intersections
*/
getIntersectionCount(): number;
/**
* Compute the boolean operation between the two input polygons
* @param operation The boolean operation type to perform
* @returns The resulting polygon from the boolean operation
*/
computeBooleanOperation(operation: number): Polygon;
private processSegment;
private possibleIntersection;
private divideSegment;
private storeSweepEvent;
}
//# sourceMappingURL=martinez.d.ts.map