Ecma getIntersectionPoints argument limited

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
duccoder
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:
Image
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
andrew
Site Admin
Posts: 7035
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:
http://www.qcad.org/bugtracker/index.ph ... sk_id=1253

Moved topic to appropriate forum (Developers).

Post Reply

Return to “QCAD Developers and Contributors”