I can't understand why I lose control of the script operation when using snaps
If someone can give me a tip, if you have time and desire and always without haste
I attach the source files:
Loss of Script operation after using snaps
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: 83
- Joined: Fri Apr 17, 2015 6:40 am
- Location: http://creativitainformaticart.altervista.org
Loss of Script operation after using snaps
- Attachments
-
- OrthogonalProjections.zip
- (18.37 KiB) Downloaded 449 times
Re: Loss of Script operation after using snaps
hello,
Seen your latest topics.
Been on your site lately, curious about the 3D button.
Can you explain in short what the purpose and the method are?
Is there a testfile associated with this?
I think none of my files would be a candidate.
At what point do you use snapping?
Is it correct that OrthogonalProjections.js is not open source?
Was it written by Andrew?
Is it correct that I see traces of ExXmlExport.js in Export3D.js?
I do understand you prefer Italian but isn't there a consensus that code itself should be written in English?
Pritty hard to trow thrue a translator like a site or a forum topic.
Regards,
CVH
Seen your latest topics.
Been on your site lately, curious about the 3D button.
Can you explain in short what the purpose and the method are?
Is there a testfile associated with this?
I think none of my files would be a candidate.
At what point do you use snapping?
Is it correct that OrthogonalProjections.js is not open source?
Was it written by Andrew?
Is it correct that I see traces of ExXmlExport.js in Export3D.js?
I do understand you prefer Italian but isn't there a consensus that code itself should be written in English?
Pritty hard to trow thrue a translator like a site or a forum topic.
Regards,
CVH
-
- Full Member
- Posts: 83
- Joined: Fri Apr 17, 2015 6:40 am
- Location: http://creativitainformaticart.altervista.org
Re: Loss of Script operation after using snaps
Hello
Oops, thank you, I have to correct the GPL license references on the scripts, it is a program that I am trying to make myself as a hobby but starting from the files and / or parts of these made by Andrew, trying to understand how it works.
What would be the most correct way to write the GPL License?
For example on a previous script I added the following after Andrew's LPG Heading:
//ParallelLines_of_Cona_Pietro_.........._Extension for QCAD.zip
// Copyright © 2005-2015 Pietro Cona
// Website: http://pietro72li.altervista.org
// Website: http://pietro72li.heliohost.org
// Under the GPL license
I don't know English, I manage with the google translator (maybe sooner or later I decide to study it ), but slowly I translate into English if it can be better this way.
I'm trying to make a little program that can put QCAD in communication with Blender-type 3D modellers through orthogonal projections exporting in 3D formats like obj, dae, dxf (with Blender it seems better to obj)
At the moment on my site I have not put any demo file, there is only an attachment to this post, but it is still early because it does what I would like
Setting the first drop-down menu on "Create 3D Entities:" and the second on "3D Vertex" (Part I'm working on) you start tracing the vertices in orthogonal projections at the first click on the XY axes and at the second click automatically on the 'Z axis and so on for each vertex, but if for example I set a relative 0 on a previous vertex and a horizontal restrict on the XY axes after it no longer traces the vertices to me and seems to stop after the 503 line of OrthogonalProjectins.js
Regards
Peter
Oops, thank you, I have to correct the GPL license references on the scripts, it is a program that I am trying to make myself as a hobby but starting from the files and / or parts of these made by Andrew, trying to understand how it works.
What would be the most correct way to write the GPL License?
For example on a previous script I added the following after Andrew's LPG Heading:
//ParallelLines_of_Cona_Pietro_.........._Extension for QCAD.zip
// Copyright © 2005-2015 Pietro Cona
// Website: http://pietro72li.altervista.org
// Website: http://pietro72li.heliohost.org
// Under the GPL license
I don't know English, I manage with the google translator (maybe sooner or later I decide to study it ), but slowly I translate into English if it can be better this way.
I'm trying to make a little program that can put QCAD in communication with Blender-type 3D modellers through orthogonal projections exporting in 3D formats like obj, dae, dxf (with Blender it seems better to obj)
At the moment on my site I have not put any demo file, there is only an attachment to this post, but it is still early because it does what I would like
Setting the first drop-down menu on "Create 3D Entities:" and the second on "3D Vertex" (Part I'm working on) you start tracing the vertices in orthogonal projections at the first click on the XY axes and at the second click automatically on the 'Z axis and so on for each vertex, but if for example I set a relative 0 on a previous vertex and a horizontal restrict on the XY axes after it no longer traces the vertices to me and seems to stop after the 503 line of OrthogonalProjectins.js
Regards
Peter
Re: Loss of Script operation after using snaps
Peter,
Like I said, I do not possess of a suitable dxf to even test it.
Did a quick read of your script....
I am just starting to learn Javascript.
And Qcad.
For one, I would use the same closing brackets sheme as Andrew does.
(round, curly or sqaured)
Blocks of code are more clearly that way.
I am using Notepad++ and then it is all so obvious.
Instead:
Set the closer under the first letter of the line where it is opened.
Its hard to believe a UserMessage would halt your script.
The mentioned else if block at line 503 includes a new RRestrictVertical(di) and you are speaking of a horizontal restrict.
If you restrict to both you can't set anything else but the relative zero.
That's what I make of it.
Regards,
CVH
Like I said, I do not possess of a suitable dxf to even test it.
Did a quick read of your script....
I am just starting to learn Javascript.
And Qcad.
For one, I would use the same closing brackets sheme as Andrew does.
(round, curly or sqaured)
Blocks of code are more clearly that way.
I am using Notepad++ and then it is all so obvious.
Instead:
Code: Select all
function{
If (xyzxyz) {
code...;
code...;
switch (this.state) {
case xyzxyz: {
code...;
code...;
}
case xyzxyz: {
code...;
}
}
}
else if (xyzxyz) {
code...;
}
};
Set the closer under the first letter of the line where it is opened.
Code: Select all
function{
If (xyzxyz) {
code...;
code...;
switch (this.state) {
case xyzxyz: {
code...;
code...;
}
case xyzxyz: {
code...;
}
}
}
else if (xyzxyz) {
code...;
}
};
Hard to follow without an example, just a few things:pietro_72_ wrote: ↑Fri Oct 04, 2019 10:41 pmbut if for example I set a relative 0 on a previous vertex and a horizontal restrict on the XY axes after it no longer traces the vertices to me and seems to stop after the 503 line of OrthogonalProjectins.js
Its hard to believe a UserMessage would halt your script.
The mentioned else if block at line 503 includes a new RRestrictVertical(di) and you are speaking of a horizontal restrict.
If you restrict to both you can't set anything else but the relative zero.
That's what I make of it.
Regards,
CVH
-
- Full Member
- Posts: 83
- Joined: Fri Apr 17, 2015 6:40 am
- Location: http://creativitainformaticart.altervista.org
Re: Loss of Script operation after using snaps
I made some corrections on the files, maybe so they are a little clearer and I also did a little movie about it.
For now, the Export 3D button only saves a file in dxf format that contains a square whose vertices are not connected to the vertices drawn on QCAD
http://creativitainformaticart.altervis ... 9%3A29.mp4
For now, the Export 3D button only saves a file in dxf format that contains a square whose vertices are not connected to the vertices drawn on QCAD
http://creativitainformaticart.altervis ... 9%3A29.mp4
- Attachments
-
- OrthogonalProjections.zip
- (18.52 KiB) Downloaded 453 times
-
- Full Member
- Posts: 83
- Joined: Fri Apr 17, 2015 6:40 am
- Location: http://creativitainformaticart.altervista.org
Re: Loss of Script operation after using snaps
I was able to solve the problem in the following way:
.....
.....
204 OrthogonalProjections.prototype.reloadingDataUI = function() {
......
.....
....
645 try {
this.nameIdObj3D = this.idObj3D.displayText;
}
catch (e) {
this.reloadingDataUI ();
this.nameIdObj3D = this.idObj3D.displayText;
}
.....
.....
.....
.....
.....
204 OrthogonalProjections.prototype.reloadingDataUI = function() {
......
.....
....
645 try {
this.nameIdObj3D = this.idObj3D.displayText;
}
catch (e) {
this.reloadingDataUI ();
this.nameIdObj3D = this.idObj3D.displayText;
}
.....
.....
.....
- Attachments
-
- OrthogonalProjections.js
- (56.4 KiB) Downloaded 420 times
-
- Istantanea_2019-11-27_10-23-06.png (268.23 KiB) Viewed 10021 times