@huukhanhnguyen/geometry / namespaces/Projection
namespaces/Projection
clipPolygonToWindow
constclipPolygonToWindow: (polygon,min_x,max_x,min_y,max_y) =>Float64Array=wasm.projection_clip_polygon_to_window
Parameters
polygon
Float64Array
min_x
number
max_x
number
min_y
number
max_y
number
Returns
Float64Array
clipSegmentToLoops
constclipSegmentToLoops: (start_x,start_y,end_x,end_y,loops_json) =>string=wasm.projection_clip_segment_to_loops
Parameters
start_x
number
start_y
number
end_x
number
end_y
number
loops_json
string
Returns
string
clipSegmentToWindow
constclipSegmentToWindow: (start_x,start_y,end_x,end_y,min_x,max_x,min_y,max_y) =>Float64Array=wasm.projection_clip_segment_to_window
Parameters
start_x
number
start_y
number
end_x
number
end_y
number
min_x
number
max_x
number
min_y
number
max_y
number
Returns
Float64Array
hiddenLineEdges
consthiddenLineEdges: (triangles,forward_x,forward_y,forward_z) =>Float64Array=wasm.projection_hidden_line_edges
Classifies every silhouette/feature edge of a view mesh into visible and hidden 2D segments.
IN: 15 f64 per triangle — world [ax, ay, az, bx, by, bz, cx, cy, cz] then projected [ax, ay, bx, by, cx, cy]; a trailing partial triangle is ignored. forward_* is the axis pointing AWAY from the viewer.
OUT: the header-prefixed packing point_cloud_cluster uses — [visible_segment_count, ...visible, ...hidden], each segment [x0, y0, x1, y1]. Segment order is the TS emission order and is part of the contract.
Parameters
triangles
Float64Array
forward_x
number
forward_y
number
forward_z
number
Returns
Float64Array
pointInLoops
constpointInLoops: (loops_json,x,y) =>boolean=wasm.projection_point_in_loops
Parameters
loops_json
string
x
number
y
number
Returns
boolean
sectionBasis
constsectionBasis: (nx,ny,nz) =>Float64Array=wasm.projection_section_basis
Parameters
nx
number
ny
number
nz
number
Returns
Float64Array