Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect results of model.combine #509

Open
PechenTreski opened this issue Aug 26, 2021 · 1 comment
Open

Incorrect results of model.combine #509

PechenTreski opened this issue Aug 26, 2021 · 1 comment
Labels

Comments

@PechenTreski
Copy link

Hello,
I came across a problem with a strange behaviour of model.combine. I have a circle and a polygon made of lines, and when I try to subtract the polygon from a circle, then a couple of lines stay visible outside of the result shape.

var circle = { 
  type: 'circle', 
  origin: [-122, -154],
  radius: 402.7,
  units: 'cm'
 };

var modelCircle = { paths: { myCircle: circle } };

var line1 = { 
  type: 'line', 
  origin: [-500, -399], 
  end: [-499, 201] 
 };
 var line2 = { 
  type: 'line', 
  origin: [-499, 201] ,
  end: [-670, -136]
 };
 var line3 = { 
  type: 'line', 
  origin: [-670, -136] ,
  end: [-500, -399] 
 };

var modelLinien = { paths: { myLine1: line1, myLine2: line2, myLine3: line3 } };

rootModel = m.model.combineSubtraction(modelCircle, modelLinien);

// same result
rootModel2 = m.model.combine(
            modelCircle,
            modelLinien,
            false,
            true,
            true,
            false
        );
		
var svg = m.exporter.toSVG(rootModel);
document.write(svg);

combine

@PechenTreski
Copy link
Author

I need to add that it only happens when the rightmost (in my case) line of the polygon is strictly vertical :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants