You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've try to clip some polygons but result is too simplificated. Here is the screenshots:
Original geometry
Light-yellow is the subj
Solution geometry
Red polygon is the clip
Yellow polygon is the intersection
Blue polygons is the diffs
All of this is result of execution of this code:
varexpress=require('express');varClipper=require('jsclipper/jsclipper-adapter');var_=require('lodash');varrouter=express.Router();router.get('/clip',function(req,res){res.header("Access-Control-Allow-Origin","*");res.header("Access-Control-Allow-Headers","X-Requested-With");varreqSubj=req.query['subj'];varreqClip=req.query['clip'];varresult={intersections: [],diffs: []};_.each(reqSubj,function(subject){//region Ensure of array types instead of objectsvarsubjShape=_.toArray(subject.slice(0,1)[0]);varsubjHoles=_.map(subject.slice(1),function(value){return_.toArray(value)});varclipShape=_.toArray(reqClip.slice(0,1)[0]);varclipHoles=_.map(reqClip.slice(1),function(value){return_.toArray(value)});//endregionvarsubj=newClipper.Polygon(subjShape,subjHoles);varclip=newClipper.Polygon(clipShape,clipHoles);varintersectSolutions=subj.intersect(clip);vardiffSolutions=subj.diff(clip);_.each(intersectSolutions,function(solution){result.intersections.push(solution.getPaths())});_.each(diffSolutions,function(solution){result.diffs.push(solution.getPaths())});});res.type('application/json');res.send(result);});module.exports=router;
So here is the question: how can i reduce or even disable polygons simplifacation?
The text was updated successfully, but these errors were encountered:
ah good point! we are working with 3d models in mm-scale in scope of 3d-printing. so a thousandth of a mm is enough precision for us.
do you have a proposal how to make this configurable?
Hello!
I've try to clip some polygons but result is too simplificated. Here is the screenshots:
Original geometry
Solution geometry
All of this is result of execution of this code:
So here is the question: how can i reduce or even disable polygons simplifacation?
The text was updated successfully, but these errors were encountered: