Hi,
Can you tell me if in qcad exists functions for :
-Get the fusion of 2 lines ?
-check if a point is included in a shape ? (can be on shape lines or inside)
-Check if a line is included in a shape ? (can be on shape lines or inside)
And give me example of use if it exists.
Thanks.
util qcad functions
Moderator: andrew
Re: util qcad functions
Please elaborate. Do you want to create a polyline? Do you want to combine two line segments into one line? ...?
For a polyline, you can use RPolyline::contains:sarlaa wrote:-check if a point is included in a shape ? (can be on shape lines or inside)
Code: Select all
polyline.contains(point, true, tolerance);
You can use RPolyline::containsShape:sarlaa wrote:-Check if a line is included in a shape ? (can be on shape lines or inside)
Code: Select all
polyline.containsShape(shape);
Re: util qcad functions
Thanks it's useful.
For my first point (fusion of 2 lines), in fact I want to combine two line segments into one line.
For my first point (fusion of 2 lines), in fact I want to combine two line segments into one line.
Re: util qcad functions
Ok.
for checking if polyline contains point I tried :
I get false, is there something I do wrong ?
for checking if polyline contains point I tried :
Code: Select all
var plItem = new RPolyline();
var pointsItem = [new RVector(0,20), new RVector(20,20), new RVector(20,0), new RVector(0,0)]
plItem.setVertices(pointsItem);
var point = new RVector(10,10)
var check = plItem.contains(point, true); //check is false
Re: util qcad functions
I see my error had to do :
It works. Thanks
Code: Select all
var pointsItem = [new RVector(0,20), new RVector(20,20), new RVector(20,0), new RVector(0,0), new RVector(0,20)]