infinite line

Discussion forum for contributors and developers who are using the QCAD ECMAScript development platform or the C++ plugin interface or who are otherwise looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Post Reply
pietro_72_
Full Member
Posts: 77
Joined: Fri Apr 17, 2015 6:40 am
Location: http://creativitainformaticart.altervista.org

infinite line

Post by pietro_72_ » Mon Sep 02, 2019 9:40 pm

Hello

How do I create an infinite line in ECMAScript?

User avatar
andrew
Site Admin
Posts: 7019
Joined: Fri Mar 30, 2007 6:07 am

Re: infinite line

Post by andrew » Tue Sep 03, 2019 7:56 am

With the QCAD Simple API:

Code: Select all

addShape(new RXLine(new RVector(100,0), new RVector(1,1)))
The second vector is the direction vector.

pietro_72_
Full Member
Posts: 77
Joined: Fri Apr 17, 2015 6:40 am
Location: http://creativitainformaticart.altervista.org

Re: infinite line

Post by pietro_72_ » Tue Sep 03, 2019 8:07 am

OK, thanks

Or even so? :
return new RXLineEntity (doc, new RXLineData (p1, p2.operator_subtract (p1)));

User avatar
andrew
Site Admin
Posts: 7019
Joined: Fri Mar 30, 2007 6:07 am

Re: infinite line

Post by andrew » Tue Sep 03, 2019 10:13 am

Yes. But your code only creates and returns an entity. It would still have to be added to the document (using an operation).

pietro_72_
Full Member
Posts: 77
Joined: Fri Apr 17, 2015 6:40 am
Location: http://creativitainformaticart.altervista.org

Re: infinite line

Post by pietro_72_ » Tue Sep 03, 2019 10:30 am

Yes, ok

Post Reply

Return to “QCAD Developers and Contributors”