UPDATE: Centroids 0.32

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
CVH
Premier Member
Posts: 3415
Joined: Wed Sep 27, 2017 4:17 pm

UPDATE: Centroids 0.32

Post by CVH » Tue Dec 14, 2021 7:56 am

All,

for obvious reasons I waited of the QCAD 3.27 release.
With the 3.27.1 release we are now past that. :wink:

Fiddled a bit with the examples drawing:
Centroid-examples-v32.dxf
(310.79 KiB) Downloaded 339 times
3 Layer States: Y1 'Area-Arc segment', Y2 'Area-Arc sector' & Y3 'Wires'.

More complex plywood example, worked out in 3D (5 Layer States):
Summing Centroids v2.dxf
(182.37 KiB) Downloaded 308 times
All without a pocket calculator. 8) :wink:

From drawing entities of 3 masses to a 3D Centroid explained in 20 steps:
HowToRecreateIn3D-UnixEOL.txt
(3.13 KiB) Downloaded 317 times

- Completed the package with a plain point mass 2D Centroid for a known mass at a given position unrelated to shapes.
- Added a custom property listener what is a handy tool when manipulation centroid markers properties or their position.
For all changes and additions I like to refer to the ChangeLog:
ChangeLog-UnixEOL.txt
(8.4 KiB) Downloaded 319 times
Both txt files are also available for Windows Notepad in the zip file in WinEOL style.


InfoCentroids 0.32.zip
Complete package
(127.07 KiB) Downloaded 323 times
The Addons are donated to the QCAD project 'as is', Andrew may include it in a next release.
In such a case it is not required to install this package or if so one can remove it completely.

Immediate installation: :arrow:
Users that have custom installed earlier versions are advised to remove the centroids folders and files.
One could also clean up the QCAD ini/conf file:
- Remove all sections with a header between squared brackets that includes '...Centroid...' literal.

Ensure that the next path exists in your installation folder:
... QCAD\scripts\Misc\MiscInformation (QCAD or QCADCAM or whatever path that is used)
Here we require MiscInformation.js, there may be a .pro file and a folder called 'dir' by default.

Copy the files from the zip over to the 'MiscInformation' path, overwriting anything that would still exist there.
The folder structure is mandatory, for reference: The changelog should be located here:
... QCAD\scripts\Misc\MiscInformation\InfoCentroids\ChangeLog-UnixEOL.txt
Folder and file naming and the placement are quite logic.
Win users may require admin rights.

Regards,
CVH

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4935
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: UPDATE: Centroids 0.32

Post by Husky » Wed Dec 15, 2021 12:13 am

Hi,

I see your tool learned to calculate things - nice! :wink:

Trying to understand how to use your tools ... may I ask you the exact meaning of the note at the Kite example what says: Quote "3 Coper wires 1,5 mm² (0,0137g/mm)" (in Summing Centroids v2.dxf)
What shape has the wire and what means 0,0137g/mm? Sorry, so far that makes no sense to me ...
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

CVH
Premier Member
Posts: 3415
Joined: Wed Sep 27, 2017 4:17 pm

Re: UPDATE: Centroids 0.32

Post by CVH » Wed Dec 15, 2021 8:17 am

Husky wrote:
Wed Dec 15, 2021 12:13 am
I see your tool learned to calculate things
Indeed, centers of gravity are already nothing but mathematics and are purely theoretical.
Why not adding the extra level?
"learned to" ... I assure you that evaluating inputs by equations is the simplest of the maths involved.

In fact, we missed the RMathLineEdit functionality that most other QCAD entry fields usually have.
Another drawback with the use of (textual) custom properties.

Just remember to activated the listener when you are editing marker properties or while re-positioning.
More maths or values to copy/paste we don't have to worry about. :wink:


For the Kite as example, I took a full core copper electrical installation wire without insulation.
In Europe we have 0.5-0.75-1-1.5-2.5-4-6-10-16-... mm² but we simply say 'carré' (squared) and draw a little square.
1.5mm² is typical used for 10 Amps lighting circuits while 2.5mm² is required for 16 Amps circuits with wall sockets.
(Or 16 Amps & 20 Amps with circuit breakers instead of thermal fuses)

I took the linear density from a table in Dutch, translated here:
https://www-circuitsonline-net.translat ... x_tr_hl=nl
It was about 1.4mm in diameter - Typical 1.54mm² cross section - 13700g/km - Similar to 17 SWG, 15 AWG

All typical because the last decades it seems that the 1.5 carré wires they are selling are shrinking. :lol:
Who is fooling who :?: :!:

Cu 8940kg/m³ ... 0.00894g/mm³ times 1.54mm² is 0.0137676g/mm what corresponds with the value from the table.

Wire centroids are based on the idea that all mass is condensed into an infinite thin wire.
Mathematically the wires have no cross section, only a length.
As long as the scale is adequate it can be a good representation.
Here we have at least a scale of 1000:1 ... 1515.3mm of wires, 1.4mm thick.
It would be incorrect for a 3/4" steel pipe Shedule 40, 1.050"OD, scale 47:1 ... Certainly when curved or with bends ... :wink:

Similar for the areal density of an enclosed or hatched area.
These surfaces have no thickness In 2D but we associate a certain mass per area reduced from a certain mass per volume.
Plywood 680kg/m³ ... 0.00068g/mm³ times 19mm thick is 0.01292 g/mm².

For simplicity we use all unit-less values.
Just ensure that the used units are correct.

Regards,
CVH

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4935
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: UPDATE: Centroids 0.32

Post by Husky » Wed Dec 15, 2021 12:33 pm

Ok, now I understand why I'm so confused!
CVH wrote:
Wed Dec 15, 2021 8:17 am
For the Kite as example, I took a full core copper electrical installation wire without insulation.
In Europe we have 0.5-0.75-1-1.5-2.5-4-6-10-16-... mm² but we simply say 'carré' (squared) and draw a little square.
1.5mm² is typical used for 10 Amps lighting circuits while 2.5mm² is required for 16 Amps circuits with wall sockets.
(Or 16 Amps & 20 Amps with circuit breakers instead of thermal fuses)

I took the linear density from a table in Dutch, translated here:
https://www-circuitsonline-net.translat ... x_tr_hl=nl
It was about 1.4mm in diameter - Typical 1.54mm² cross section - 13700g/km - Similar to 17 SWG, 15 AWG
Well, if you refer to that source it is properly a good choice if you need to explain your tool to an Electrician and use his for him/her familiar terms to make it more understandable. Every NON Electrician like me has a hard time to understand what you are talking about. If I built/calculate something like a Kite I don't care how much Amps my wire could handle. I've to figure out when my wire will break ...
CVH wrote:
Wed Dec 15, 2021 8:17 am
All typical because the last decades it seems that the 1.5 carré wires they are selling are shrinking. :lol:
Who is fooling who :?: :!:
No, that is not typical in this case. Again, Electrician have different needs and goals. In Mechanical Engineering doesn't exist something like "The diameter is 1.4 ... or 1.54 or its getting even thinner etc etc.. There is only: It is a diameter of sharp 1.5 mm. Period!

Maybe next time use a source for Table of Density like https://sciencenotes.org/table-of-densi ... materials/
BTW: Unit for density is always in cubic like g/cm³ and never just an area like stated in your example drawing. That the paper is defined by area has other reasons.
CVH wrote:
Wed Dec 15, 2021 8:17 am
Cu 8940kg/m³ ... 0.00894g/mm³ times 1.54mm² is 0.0137676g/mm what corresponds with the value from the table.
Correct would be 0.0137676g/mm³,

Howsoever: I tested the Area centroid. Looks good to me.
I tested also the Wire centroid. I think that is very confusing and I'm pretty sure not many will invest the time to understand and figure out how it works. Most challenging is the requirement to calculate a specific custom density which is not obviously and nowhere explained (yes I know it comes with a txt file). I understand the problem that you have to cover all possible wire shapes (round, rectangle, square etc.) but I think it is crucial for a user to use density numbers as there are found in www or books.

BUT ..... your tool learned to calculate! Maybe you can use this new ability. :wink:

I don't think that it makes sense to implement all possible wire shapes. As a shortcut you could use a wire area as an input. Combined with the real Density value a calculation in the background should be easy for your tool.
Practical workflow would then be:
Select wire,
launch Wire centroid,
Property Editor / Custom Fields / Area: 1.5, Density 0.00894 (for Cooper) .... and your tool calculates the Point mass.
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

CVH
Premier Member
Posts: 3415
Joined: Wed Sep 27, 2017 4:17 pm

Re: UPDATE: Centroids 0.32

Post by CVH » Wed Dec 15, 2021 2:10 pm

Husky wrote:
Wed Dec 15, 2021 12:33 pm
BTW: Unit for density is always in cubic like g/cm³ and never just an area like stated in your example drawing.
There is nothing wrong with a mass per area or per length.
- Areal: https://en.wikipedia.org/wiki/Area_density (SI: kg/m²)
- Linear: https://en.wikipedia.org/wiki/Linear_density (SI: kg/m)
- Volumetric: https://en.wikipedia.org/wiki/Density (SI: kg/m³)
- For liquids and gasses we also use the relative density, usually compared with water/standard air (SI: unit-less factor)
In short and generalized as 'Density'. :wink:
Husky wrote:
Wed Dec 15, 2021 12:33 pm
There is only: It is a diameter of sharp 1.5 mm. Period!
What I meant is that old wires 1,5 carré were over 1.4 mm in diameter.
Taking it the safe side ...
The ones I buy today are more like 1.3 mm in diameter ... But also sold marked as 1,5 carré.
That costs less of the expensive copper to make, sure, but the wires get hotter for the same load.
Husky wrote:
Wed Dec 15, 2021 12:33 pm
Practical workflow would then be:
...
..
I know, I then have to diversify on everything ... Densities ... Origin ... 3D shape
... Unit conversions ... Material properties ...
For now that is left to the engineer in us. :wink:

When the wires break is Kinematics, Stress Load calculations, and a complete other ball-park.
And still, most of that maths requires the centroids of things.

We are not calculating the Amps, but where to locate the center of mass of those wires.
It was simply an old wire laying around that I used and from where I sourced the info.
Now you also know where we use it for ...
... Except for an experimental kite to verify a QCAD result. :lol: :lol:

Regards,
CVH

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4935
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: UPDATE: Centroids 0.32

Post by Husky » Wed Dec 15, 2021 9:47 pm

CVH wrote:
Wed Dec 15, 2021 2:10 pm
When the wires break is Kinematics, Stress Load calculations, and a complete other ball-park.
And still, most of that maths requires the centroids of things.
Ok, looks like you try to illuminate the Kite and I try to make it resistant against a storm. Agree that is an other ball park but I will stick to my game. Good luck for your tool - I'm out on this topic.
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”