check if it's really a 3D point

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

check if it's really a 3D point

SFQ_0
Hi there

as I recently learnt from Dellus I can id the co-ordinates by 'list entities'



Unfortunatly there's no z-value altough it should be a 3D point loaded via ASCII file, TAB separated.

10	2677320.716	1250262.118	235.235
11	2677313.305	1250263.435	236.236
12	2677311.434	1250266.241	237.237
13	2677313.216	1250267.788	238.238
14	2677321.686	1250265.007	239.239
How do I check that the z-value from the ASCII file is beeing recognised and the created point is really a 3D point?

Thanks for your help
Frank
Reply | Threaded
Open this post in threaded view
|

Re: check if it's really a 3D point

perepujal
LibreCad is a Cross-platform Open-source 2D CAD, so I guess no, points are not 3D points.

I usually import points from ascii files in the form of
Number,Xvalue,Yvalue,Zvalue  like

100             ,     100.000,     100.000,   100.000, 0              
101             ,      47.183,      59.070,   122.316, 0              
102             ,      77.196,      31.408,   122.178, 0              
103             ,      84.496,      23.883,   121.862, 0              
and so on

What I get when I import those points from an ascii file is:

Number converted to a string displayed next to the point
X converted to the X value of the point
Y converted to the Y value of the point
Z converted to a string displayed next to the point

Sometimes, and depending of the needed result, I transpose and recompute those points before importing to LibreCAD in order to get the projection of a facade in the plane of draw, but inside LibreCad they continue to be 2D points
Reply | Threaded
Open this post in threaded view
|

Re: check if it's really a 3D point

SFQ_0
Thanks for your reply.

You may have a point there, saying it is 2D.
What made me think my approach might actually work is the dialog window for ascii imort



I specifically checked the 'draw 3D point' option without trying the 2D option above first.
Reply | Threaded
Open this post in threaded view
|

Re: check if it's really a 3D point

perepujal
Well, in the doubt, I've just looked at the asciifile plugin sources and found that the code suposed to store the 3D value in the point is commented out.
See https://github.com/LibreCAD/LibreCAD/blame/master/plugins/asciifile/asciifile.cpp#L443
So I guess you can't get the Z value from the point itself :(

Later I imagined a way to extract the Z value from the string contents of the elevation values:
If when importing the ascii file you tell the plugin to store the elevation as text and if later the list entities plugin outputs the text point insertion and the text string of the elevation, then with some modification of the script you provide on the other thread you could correlate them to the corresponding point.

The problem is that the list entities plugin doesn't output currently those values, so here is a patch for it, I don't know if that would be useful, anyway hope this helps.


diff --git a/plugins/list/list.cpp b/plugins/list/list.cpp
index e585afee..b770352f 100644
--- a/plugins/list/list.cpp
+++ b/plugins/list/list.cpp
@@ -177,6 +177,10 @@ QString LC_List::getStrData(Plug_Entity *ent) {
         break;
     case DPI::TEXT:
         strData.prepend( strEntity.arg(tr("TEXT")));
+       strData.append( strSpecificXY.arg(tr("in point")).
+                        arg(d->realToStr(data.value(DPI::STARTX).toDouble())).
+                        arg(d->realToStr(data.value(DPI::STARTY).toDouble())));
+       strData.append(strSpecific.arg(tr("TEXTCONTENT")).arg(data.value(DPI::TEXTCONTENT).toString()));
         break;
     case DPI::INSERT:
         strData.prepend( strEntity.arg(tr("INSERT")));
Reply | Threaded
Open this post in threaded view
|

How do I use this code?

SFQ_0
Thank you for the effort and the detailed report.

That second approach -to get those values from the label contents (point number, height or code)- failed for me when the 'list entities'-function didn't return them in the output window, as you noticed as well.

I'm afraid I have no idea as to how use this patch you appended. Copy-paste into the command console? Open some config file and put it there?

It's just that for land surveyors this is the single most useful purpose of a CAD. Get co-ordinates out of it and transfer them to  their instruments for further use in the field.

Reply | Threaded
Open this post in threaded view
|

Re: How do I use this code?

perepujal
The patch is for modifying the list entities plugin source code, aftter modified, it should be compiled and installed on the system.
So to be able to use it you should be able to compile LibreCAD, (or hope the developers include it and then the added functionallity will appear in a new build)

I was hoping to get some feedback before I submited the patch for inclusion, hope the LibreCAD developers found it worth of adding
https://github.com/LibreCAD/LibreCAD/pull/1325
Hope this helps
Pere
Reply | Threaded
Open this post in threaded view
|

Re: How do I use this code?

LordOfBikes
Administrator
Many thanks Pere,

your pull request was merged right now.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution