mesh.getPlanes?

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

mesh.getPlanes?

Post by Roy_043 »

I am trying to use the last code sample on the Mesh_to_Part wiki page.

Code: Select all

segments = mesh.getPlanes(0.00001)
Does not work, the method does not exist (anymore?). What should be used here?
User avatar
HakanSeven12
Veteran
Posts: 1481
Joined: Wed Feb 06, 2019 10:30 pm

Re: mesh.getPlanes?

Post by HakanSeven12 »

I'm using this to get cross sections.

Code: Select all

CrossSections = Mesh.crossSections(
                    [((0, 0, H), (0, 0, 1))], 0.000001)
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: mesh.getPlanes?

Post by Roy_043 »

Thanks, but as far as I understand the getPlanes method should combine co-planar triangular faces.
wmayer
Founder
Posts: 20242
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: mesh.getPlanes?

Post by wmayer »

Use getPlanarSegments instead.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: mesh.getPlanes?

Post by Roy_043 »

Thanks. But that method seems to always return an empty list:

Code: Select all

import Mesh
import Part
import MeshPart

planarMesh = [
# triangle 1
[-0.5000, -0.5000, 0.0000], [0.5000, 0.5000, 0.0000], [-0.5000, 0.5000, 0.0000],
#triangle 2
[-0.5000, -0.5000, 0.0000], [0.5000, -0.5000, 0.0000], [0.5000, 0.5000, 0.0000],
]
planarMeshObject = Mesh.Mesh(planarMesh)
segments = planarMeshObject.getPlanarSegments(0.00001)

print(len(segments))
wmayer
Founder
Posts: 20242
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: mesh.getPlanes?

Post by wmayer »

For the record: the renaming was done 8 years ago: git commit 23f4ce0d8f
wmayer
Founder
Posts: 20242
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: mesh.getPlanes?

Post by wmayer »

User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: mesh.getPlanes?

Post by Roy_043 »

Thanks.
Post Reply