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

Offset artifacts at larger distances #8

Open
lorenrogers opened this issue Apr 22, 2020 · 1 comment
Open

Offset artifacts at larger distances #8

lorenrogers opened this issue Apr 22, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@lorenrogers
Copy link

Thanks for the wonderful library! It's exactly what I need!

For my application, I'm looking to make multiple large offsets of a single shape. Unfortunately it seems like there are some artifacts that show up at larger distances.

image

Here's the source:

(function() {                                                                                                                                                          
  function RunDemo() {                                                                                                                                                 
                                                                                                                                                                       
    let canvas = document.querySelector('canvas')                                                                                                                      
    paper.setup(canvas)                                                                                                                                                
                                                                                                                                                                       
    function outset(item, distance, iterations) {                                                                                                                      
      for (var i = 0; i < iterations; i++) {                                                                                                                           
        PaperOffset.offset(item, i*distance);                                                                                                                          
      }                                                                                                                                                                
    }  

    let c3 = new paper.Path.Circle({ center: [180, 260], radius: 50, strokeColor: 'black' })                                                                           
    let c4 = new paper.Path.Circle({ center: [230, 260], radius: 40, strokeColor: 'black' })                                                                           
    let c5 = new paper.Path.Circle({ center: [205, 200], radius: 40, strokeColor: 'black' })                                                                           
    let cc1 = c3.unite(c4, { insert: true })                                                                                                                           
    let cc = cc1.unite(c5, { insert: true })                                                                                                                           
    c3.remove()                                                                                                                                                        
    c4.remove()                                                                                                                                                        
    c5.remove()                                                                                                                                                        
    cc1.remove()                                                                                                                                                       
    cc.bringToFront()                                                                                                                                                  
    outset(cc, 4, 30);                                                                                                                                                 
  }                                                                                                                                                                    
  window.onload = RunDemo                                                                                                                                              
})()
@glenzli glenzli added the bug Something isn't working label Apr 26, 2020
@glenzli
Copy link
Owner

glenzli commented Apr 26, 2020

I'll try to improve this, but I can't promise a timeline. Hope I can fix this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants