TetGen for mesh

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
vinphend
Posts: 9
Joined: Sun Sep 19, 2010 2:05 pm

Re: TetGen for mesh

Post by vinphend »

Thank you! I was able to compile FreeCAD. Next issue - I do not understand, why App.Vector.getAngle() is a non const method. It is a little bit annoying, when I want to

Code: Select all

import Mesh
base = [ App.Vector (350, 300, 0), App.Vector (-350, 300, 0), App.Vector (-350, 300, 50)]
facet = [App.Vector (-50, 0, 0), App.Vector (-50, 300, -300), App.Vector (-50, 300, 0)]
newmesh = Mesh.Mesh()
newmesh.addFacet(base[0],base[1],base[2])
newmesh.addFacet(facet[0],facet[1],facet[2])
facet0 = newmesh.Facets[0]
facet1 = newmesh.Facets[1]
facet0.Normal.getAngle(facet1.Normal)
and error is rised

Code: Select all

Traceback (most recent call last):
  File "<input>", line 1, in <module>
ReferenceError: This object is immutable, you can not set any attribute or call a non const method
. I am using the following walk around

Code: Select all

Normal0 = facet0.Normal + App.Vector(0,0,0)
Normal1 = facet1.Normal + App.Vector(0,0,0)
Normal0.getAngle(Normal1)
Any ideas to make this code more human readable?
wmayer
Founder
Posts: 20324
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: TetGen for mesh

Post by wmayer »

Any ideas to make this code more human readable?
Don't worry! This is definitely a bug which I have fixed right now.
Post Reply