[SOLVED]Problem with Mesh.crossSections()

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
JensenLyf
Posts: 19
Joined: Thu Jul 12, 2018 1:11 pm

[SOLVED]Problem with Mesh.crossSections()

Post by JensenLyf »

Hello Everyone , recently i'v encountered a problem when i use the Mesh.crossSections().
As shown in the pictures, is a mesh object. It has a height of 20 and i try to get the cross section at the height of 10 with

Code: Select all

mesh.crossSections([((0,0,10),(0,0,1))],0.00001)
but i get the wrong result. I guess it is because of a horizontal line i marked in the picture, it coincidents with the cross section height.How can i solve this problem?
Image
Image

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 2.9.2017
Build type: Release
Branch: releases/FreeCAD-0-17
Hash: 3bb5ff4e70c0c526f2d9dd69b1004155b2f527f2
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: Chinese/China (zh_CN)
Last edited by JensenLyf on Thu Dec 13, 2018 12:34 am, edited 1 time in total.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Problem with Mesh.crossSections()

Post by microelly2 »

Never has a problem with this command. Maybe it's really a bug.

What happens if you change the height a little bit say to 10.0001 ?
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Problem with Mesh.crossSections()

Post by Kunda1 »

What pictures? (nvm, the page didn't originally load correctly)

Also how did you install FreeCAD ? I've never seen the FC output like that before:
JensenLyf wrote: Thu Dec 06, 2018 1:19 pm OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 2.9.2017
Build type: Release
Branch: releases/FreeCAD-0-17
Hash: 3bb5ff4e70c0c526f2d9dd69b1004155b2f527f2
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: Chinese/China (zh_CN)
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
JensenLyf
Posts: 19
Joined: Thu Jul 12, 2018 1:11 pm

Re: Problem with Mesh.crossSections()

Post by JensenLyf »

Kunda1 wrote: Fri Dec 07, 2018 3:09 pm What pictures? (nvm, the page didn't originally load correctly)

Also how did you install FreeCAD ? I've never seen the FC output like that before:
JensenLyf wrote: Thu Dec 06, 2018 1:19 pm OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 2.9.2017
Build type: Release
Branch: releases/FreeCAD-0-17
Hash: 3bb5ff4e70c0c526f2d9dd69b1004155b2f527f2
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: Chinese/China (zh_CN)
Oh ,please forgive me about that :oops: .I forgot I've edited the branding.xml file. That's about months ago when I just started to know something about FC.
Here is the right information about my FC.

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13522 (Git)
Build type: Release
Branch: releases/FreeCAD-0-17
Hash: 3bb5ff4e70c0c526f2d9dd69b1004155b2f527f2
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: Chinese/China (zh_CN)
JensenLyf
Posts: 19
Joined: Thu Jul 12, 2018 1:11 pm

Re: Problem with Mesh.crossSections()

Post by JensenLyf »

microelly2 wrote: Fri Dec 07, 2018 8:53 am Never has a problem with this command. Maybe it's really a bug.

What happens if you change the height a little bit say to 10.0001 ?
10.0001 works :) . So this is a bug?
I attached my files here.
Attachments
MeshProblem.FCStd
(29.47 KiB) Downloaded 31 times
JensenLyf
Posts: 19
Joined: Thu Jul 12, 2018 1:11 pm

Re: Problem with Mesh.crossSections()

Post by JensenLyf »

microelly2 wrote: Fri Dec 07, 2018 8:53 am Never has a problem with this command. Maybe it's really a bug.

What happens if you change the height a little bit say to 10.0001 ?
I do some tests ,and found it is a common problem.
This is a sphere in pic1, i try to get the cross section of it at z=0 where there exist horizontal mesh line.Also get the wrong result shown as pic2.
Image

Image
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Problem with Mesh.crossSections()

Post by Kunda1 »

JensenLyf wrote: Sat Dec 08, 2018 3:30 am
Can you test with 0.18_pre build? https://github.com/FreeCAD/FreeCAD/rele ... g/0.18_pre
Remember to make a duplicate backup of your 0.17 file and open it in 0.18dev because it's not backward compatible.
0.18 is expected to be out in the coming months and it is very stable. Most of the users on this forum, IMO, are using 0.18_pre (but I don't have metrics to back that up).
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
JensenLyf
Posts: 19
Joined: Thu Jul 12, 2018 1:11 pm

Re: Problem with Mesh.crossSections()

Post by JensenLyf »

Kunda1 wrote: Sat Dec 08, 2018 11:34 am
JensenLyf wrote: Sat Dec 08, 2018 3:30 am
Can you test with 0.18_pre build? https://github.com/FreeCAD/FreeCAD/rele ... g/0.18_pre
Remember to make a duplicate backup of your 0.17 file and open it in 0.18dev because it's not backward compatible.
0.18 is expected to be out in the coming months and it is very stable. Most of the users on this forum, IMO, are using 0.18_pre (but I don't have metrics to back that up).
Thanks for your advice, I tested it with 0.18, problem still there.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Problem with Mesh.crossSections()

Post by Kunda1 »

JensenLyf wrote: Mon Dec 10, 2018 2:50 am Thanks for your advice, I tested it with 0.18, problem still there.
Please open a ticket on the bugtracker https://www.freecadweb.org/tracker/my_view_page.php
link to this forum thread and create a link here using the bug phpBB markup

Code: Select all

[bug][/bug]
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Problem with Mesh.crossSections()

Post by paullee »

Just thought FC can turn a mesh object into a solid shape, can it?
Post Reply