fix imported function syntax

This commit is contained in:
bakedpotatolord 2025-07-11 15:45:42 -06:00
commit a5e0a0a48e

View file

@ -504,7 +504,7 @@ export async function traces(settings, widget, single) {
}; };
/** /**
* Returns an array of arrays of perpindicular triangles in the mesh. * Returns an array of arrays of perpindicular triangles in the mesh.
* Each sub-array is a list of triangle data that are part of the same * Each sub-array is a list of triangle data that are part of the same
* cylinder. * cylinder.
@ -514,7 +514,7 @@ export async function traces(settings, widget, single) {
* @param {object} opts - options object * @param {object} opts - options object
* @return {array} - array of arrays of triangle data * @return {array} - array of arrays of triangle data
*/ */
CAM.cylinders = async (settings, widget, opts) => { export async function cylinders(settings, widget, opts){
let {} = opts ?? {} let {} = opts ?? {}
@ -556,19 +556,21 @@ CAM.cylinders = async (settings, widget, opts) => {
return Array.from(cylinderTriangles.values()) return Array.from(cylinderTriangles.values())
} }
CAM.surface_find = function(widget, faces, radians) {
CAM.surface_prep(widget);
return widget.tool.findConnectedSurface(faces, radians || 0, 0.0);
};
CAM.cylinder_find = (widget, face)=>{ /**
* Find all triangles that are part of the same cylinder as the given triangle
* @param {Widget} widget - widget object
* @param {number} face - index of face in triangle vertex data
* @return {array} - array of all triangle data that belong to the same cylinder
*/
export async function cylinder_find (widget, face){
CAM.surface_prep(widget); CAM.surface_prep(widget);
return widget.tool.findCylinderSurface(face); return widget.tool.findCylinderSurface(face);
} }
CAM.cylinder_poly_find = (widget, face)=>{ export async function cylinder_poly_find(widget, face){
CAM.surface_prep(widget); CAM.surface_prep(widget);
let faces = CAM.cylinder_find(widget, face); let faces = cylinder_find(widget, face);
let vert = widget.getGeoVertices({ unroll: true, translate: true }).map(v => v.round(4)); let vert = widget.getGeoVertices({ unroll: true, translate: true }).map(v => v.round(4));