Hello
How do I create an infinite line in ECMAScript?
infinite line
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
-
- Full Member
- Posts: 81
- Joined: Fri Apr 17, 2015 6:40 am
- Location: http://creativitainformaticart.altervista.org
Re: infinite line
With the QCAD Simple API:
The second vector is the direction vector.
Code: Select all
addShape(new RXLine(new RVector(100,0), new RVector(1,1)))
-
- Full Member
- Posts: 81
- Joined: Fri Apr 17, 2015 6:40 am
- Location: http://creativitainformaticart.altervista.org
Re: infinite line
OK, thanks
Or even so? :
return new RXLineEntity (doc, new RXLineData (p1, p2.operator_subtract (p1)));
Or even so? :
return new RXLineEntity (doc, new RXLineData (p1, p2.operator_subtract (p1)));
Re: infinite line
Yes. But your code only creates and returns an entity. It would still have to be added to the document (using an operation).
-
- Full Member
- Posts: 81
- Joined: Fri Apr 17, 2015 6:40 am
- Location: http://creativitainformaticart.altervista.org
Re: infinite line
Yes, ok