Ecma getIntersectionPoints argument limited

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

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
Active Member
Posts: 30
Joined: Thu Jun 25, 2015 10:11 am

Ecma getIntersectionPoints argument limited

Post by duccoder » Thu Aug 27, 2015 3:40 am

Hi Andrew, I use ECMAScript to get intersection points between 2 entities with Qcad Pro.
getIntersectionPoints (const RShape &other, bool limited=true, bool same=false, bool force=false) const
And my sample code:
var rs1 = new RSpline();
  rs1.appendFitPoint(new RVector(1, 2));
  rs1.appendFitPoint(new RVector(3, 3));
  rs1.appendFitPoint(new RVector(6, 10));
  rs1.appendFitPoint(new RVector(21, 25));
  var sp1 = drawSpline('sp1',rs1);

  var rs2 = new RSpline();
  rs2.appendFitPoint(new RVector(-1, -1));
  rs2.appendFitPoint(new RVector(3, 2));
  rs2.appendFitPoint(new RVector(6, 3));
  rs2.appendFitPoint(new RVector(9, 10));
  rs2.appendFitPoint(new RVector(24, 25));
  var sp2 = drawSpline('sp2',rs2);

  var rl1 = new RLine(new RVector(5, 0), new RVector(25, 0));
  var l1 = drawLine('l1',rl1);

  print('l1 vs s1: ' + rl1.getIntersectionPoints(rs1, false));
  print('l1 vs s2:' + rl1.getIntersectionPoints(rs2, false));
And dxf file:
Then I run my code with:
- QCAD 3.9.4:

Code: Select all

l1 vs s1: 
l1 vs s2:RVector(0.0292292, 0, 0, true)
Execution time: 33 milliseconds
but when 3.10.10

Code: Select all

l1 vs s1:
l1 vs s1:
Execution time: 31 milliseconds
So, I can't get intersection of l1 and s1 with Qcad 3.10.10
Help me solve this, please

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

Re: Ecma getIntersectionPoints argument limited

Post by andrew » Thu Aug 27, 2015 7:44 am

Thanks for your report.

Moved issue to bug tracker at: ... sk_id=1253

Moved topic to appropriate forum (Developers).

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”