Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • extensions extensions
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 76
    • Issues 76
    • List
    • Boards
    • Service Desk
    • Milestones
    • Requirements
  • Merge requests 13
    • Merge requests 13
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • InkscapeInkscape
  • extensionsextensions
  • Issues
  • #240
Closed
Open
Created Jun 08, 2020 by Martin Owens@doctormo☕Owner

Write star and arc sodipodi path creators

Many extensions draw stars and arc using the sodipodi namespaces, this works ok when the paths are sent back to inkscape, but cause problems if you ask for the bounding box or want to use inkex outside of the inkscape context.

Marc has provided a javascript version of how to write the stars:

Star.prototype.draw_star=function(r_ext,n_pic,r_int,poly,angle_dec){
  angle_dec=angle_dec||0;
  s="M"+r_ext+" 0L";
  for( var i=0; i<n_pic; i++){
    s+=Math.cos(2*Math.PI*i/n_pic)*r_ext+","+Math.sin(2*Math.PI*i/n_pic)*r_ext
        +" ";
    if(!poly){
      s+=Math.cos(2*Math.PI*(i+0.5)/n_pic+angle_dec)*r_int+","
          +Math.sin(2*Math.PI*(i+0.5)/n_pic+angle_dec)*r_int+" ";
    }
  }
  s+="z";
  return s;
};

This code, and arc code needs to be added in the def path section if path is not defined yet (or if the sodipodi settings get set) This might involve separate classes like is currently done for Layer

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking