Page 1 of 2

3D polygon mesh volume calculation

Posted: Tue Feb 21, 2023 6:22 am
by 15685014
Hello.
I use latest TeeChart 4.2023.2.17 in a WinForms application targeting .NET 5.0.
I have a Points3D series with some sample values (it can be converted to TriSurface if needed).
Is it possible to calculate volume of a 3D mesh that is limited by series lines? Is there a special function or something?
Thank you.

Re: 3D polygon mesh volume calculation

Posted: Tue Feb 21, 2023 3:54 pm
by Christopher
Hello,
bairog wrote:
Tue Feb 21, 2023 6:22 am
I use latest TeeChart 4.2023.2.17 in a WinForms application targeting .NET 5.0.
I have a Points3D series with some sample values (it can be converted to TriSurface if needed).
Is it possible to calculate volume of a 3D mesh that is limited by series lines? Is there a special function or something?
Thank you.
That's an interesting question, but unfortunately, as things stand, the answer is no—no we don't have a function to calculate the volume (nor surface area) of 3D series types. Just to be clear—are you talking about generating 3D meshes as in this post and then calculating their volume?

Re: 3D polygon mesh volume calculation

Posted: Tue Feb 21, 2023 4:23 pm
by 15685014
Christopher wrote:
Tue Feb 21, 2023 3:54 pm
Just to be clear—are you talking about generating 3D meshes as in this post and then calculating their volume?
Yes, I'm talking about something like that. My mesh is something like:
Image

Re: 3D polygon mesh volume calculation

Posted: Tue Feb 21, 2023 4:50 pm
by Christopher
Hello,
bairog wrote:
Tue Feb 21, 2023 4:23 pm
Yes, I'm talking about something like that. My mesh is something like:
Looks an interesting problem. What you're looking for sounds like a Volume Mesh—I've found a couple of opensource libraries which might be able to perform this operation, but nothing written in C#. Have you been able to find a promising looking library?

Re: 3D polygon mesh volume calculation

Posted: Tue Feb 21, 2023 5:13 pm
by 15685014
For now I've found this StackOveflow question answer and library geometry3Sharp that is mentioned here. Haven't tested them yet :)

Re: 3D polygon mesh volume calculation

Posted: Tue Feb 21, 2023 5:37 pm
by Christopher
Hello,
bairog wrote:
Tue Feb 21, 2023 5:13 pm
For now I've found this StackOveflow question answer and library geometry3Sharp that is mentioned here. Haven't tested them yet :)
It looks as though the Stackoverflow user @bairog appears in the comments section of that question with posts from this time last year ... is that you? :)

Re: 3D polygon mesh volume calculation

Posted: Wed Feb 22, 2023 4:15 am
by 15685014
Yes it was me :) . I was assigned a task which included 3D mesh volume calculation a year ago. But short time later I was switched to another project. And now initial task is relevant for me again.

Re: 3D polygon mesh volume calculation

Posted: Wed Feb 22, 2023 11:25 am
by Christopher
Hello,

I see that geometry3Sharp now recommends geometry4Sharp, and that this library contains things such as 'MeshMeasurements' which include volume. It looks as though it could be useful.

Re: 3D polygon mesh volume calculation

Posted: Wed Feb 22, 2023 1:27 pm
by 15685014
Maybe you can use the math from this library to calculate the volume of a 3D mesh (looks like most suitable for TriSurface series).

Re: 3D polygon mesh volume calculation

Posted: Wed Feb 22, 2023 6:08 pm
by Christopher
Hello,
bairog wrote:
Wed Feb 22, 2023 1:27 pm
Maybe you can use the math from this library to calculate the volume of a 3D mesh (looks like most suitable for TriSurface series).
Well, I've got as far as this:
https://github.com/Steema/MeshVolume

Which is to say I've drawn a sphere in the Chart using a Points3D series. What's missing is taking the points returned from SphereCoordinates() and feeding them into geometry4Sharp and getting a volume back ...

Re: 3D polygon mesh volume calculation

Posted: Thu Feb 23, 2023 12:10 pm
by Christopher
Hello,
Christopher wrote:
Wed Feb 22, 2023 6:08 pm
Which is to say I've drawn a sphere in the Chart using a Points3D series. What's missing is taking the points returned from SphereCoordinates() and feeding them into geometry4Sharp and getting a volume back ...
I've found some an old example repo which uses geometry3Sharp and I've updated it to geometry4Sharp. The demos aren't very good, but they do give more of an idea of how to use the library. I've added them to our repo, which you can clone with:

Code: Select all

git clone --recurse-submodules https://github.com/Steema/MeshVolume.git

Re: 3D polygon mesh volume calculation

Posted: Wed Mar 01, 2023 5:16 am
by 15685014
Christopher wrote:
Thu Feb 23, 2023 12:10 pm
I've found some an old example repo which uses geometry3Sharp and I've updated it to geometry4Sharp. The demos aren't very good, but they do give more of an idea of how to use the library.
Are you talking about geometry3SharpDemos repo?
As I see unfortunatelly it has no example of using MeshMeasurements at all :( Hope you will manage to get further somehow..

Re: 3D polygon mesh volume calculation

Posted: Wed Mar 01, 2023 7:35 am
by Christopher
Hello,
bairog wrote:
Wed Mar 01, 2023 5:16 am
As I see unfortunatelly it has no example of using MeshMeasurements at all :( Hope you will manage to get further somehow..
I thought I was trying to help you here :) I doubt I'm going to be able to get any further on this, but if I do I'll let you know.

Re: 3D polygon mesh volume calculation

Posted: Wed Mar 01, 2023 7:51 am
by 15685014
Christopher wrote:
Wed Mar 01, 2023 7:35 am
I thought I was trying to help you here :) I doubt I'm going to be able to get any further on this, but if I do I'll let you know.
Looks like I misunderstood you - I thought that you would try to add a volume calculation function to your charting library. Sorry.

Re: 3D polygon mesh volume calculation

Posted: Wed Mar 01, 2023 8:33 am
by Christopher
Hello,
bairog wrote:
Wed Mar 01, 2023 7:51 am
Looks like I misunderstood you - I thought that you would try to add a volume calculation function to your charting library. Sorry.
Sorry, to be clear, we have no plans to add this kind of functionality to TeeChart at this time; although TeeChart does perform a rudimentary kind of polygon meshing in its Surface and TriSurface series, we don't have any plans to add volume meshing to it.