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

Arc not shown in progeCAD #56

Closed
vanowm opened this issue Oct 23, 2021 · 1 comment
Closed

Arc not shown in progeCAD #56

vanowm opened this issue Oct 23, 2021 · 1 comment

Comments

@vanowm
Copy link

vanowm commented Oct 23, 2021

in progeCAD the arc has 0 to every parameter, so it's not shown.

Looking at http://docs.autodesk.com/ACD/2011/ENU/filesDXF/WS1a9193826455f5ff18cb41610ec0a2e719-7a35.htm it seem the arc supposed be as a subclass of an AcDbCircle
And indeed when I changed arc class to:

class Arc extends DatabaseObject
{
    /**
     * @param {number} x1 - Center x
     * @param {number} y1 - Center y
     * @param {number} r - radius
     * @param {number} startAngle - degree 
     * @param {number} endAngle - degree 
     */
    constructor(x1, y1, r, startAngle, endAngle)
    {
        super(["AcDbEntity", "AcDbCircle"])
        this.x1 = x1;
        this.y1 = y1;
        this.r = r;
        this.startAngle = startAngle;
        this.endAngle = endAngle;
    }

    toDxfString()
    {
        //https://www.autodesk.com/techpubs/autocad/acadr14/dxf/line_al_u05_c.htm
        let s = `0\nARC\n`;
        s += super.toDxfString();
        s += `10\n${this.x1}\n20\n${this.y1}\n30\n0\n40\n${this.r}\n`;
        s += "100\nAcDbArc\n";
        s += `8\n${this.layer.name}\n`;
        s += `50\n${this.startAngle}\n51\n${this.endAngle}\n`;
        return s;
    }
}

progeCAD shows it properly

@ognjen-petrovic
Copy link
Collaborator

Great, please create PR.

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

No branches or pull requests

2 participants