New Object Property: Material

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
dchigrin
Posts: 76
Joined: Tue Dec 07, 2010 9:19 am
Location: Witten, Germany
Contact:

Re: New Object Property: Material

Post by dchigrin »

well, this is what we call "cultural differences" :roll:. In electromagnetics (FEM, FDTD, MOM, etc.) our models are seldom very complex. E.g. cell-phone or car electromagnetics models are never so advanced and complex as automotive or civil engendering models. The most complex model I can think of would be a human body, which in any case would never be created in CAD directly. This is why, it is an industrial standard to assign material ID to all (even simplest, like box) objects in the electromagnetics CAD. I do understand your point, but I would also really appreciate finding a compromise. At the moment one can add any property to an existing PartFeature object, but one cannot do that with predefined primitive part objects (box, sphere, cylinder, etc.) Could we possibly add a new addProperty() method to a Part module, which would allow to add an arbitrary ID to already existing (given via Gui) objects? In this way the planed FreeCAD structure will not be affected: all primitive objects would not have a material ID by default. But we would have a possibility to add this ID to any object we want to have it, without a necessity to re-implement basic part object as a PartFeature. What would you think about that option?
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: New Object Property: Material

Post by jriegel »

Unfortunately - nothing. ;)

The aim of a data model expressed in a class model is the well defined amount of attributes and methods of an object is contradictorily.
addProperty() is only possible on python objects derived from one of the base types and works only in a interpreter with
weak typing (like python). Most of the FreeCAD objects are C++ objects and there for immutable after compile time.
Also a lot modules relay on a defined interface to our basic objects, as its also needed for load/save operations.
A user defined totally fuzzy data model is not what I want. Its like saying XML is a data standard....

Nevertheless its not needed to put every application speciality into the base system. There fore FreeCAD knows a lot
extension methodes you can use! If you don't like subclassing of objects you need, you can do composition (like I did in Robot).
You make a SimDressup object in python which links a PartFeature. Attach all properties you need and make a execute() method
which import the shape from the linked object. You can write your methodes to use those objects and can link all kind of PartFeature
derived objects.
Stop whining - start coding!
dchigrin
Posts: 76
Joined: Tue Dec 07, 2010 9:19 am
Location: Witten, Germany
Contact:

Re: New Object Property: Material

Post by dchigrin »

okay, thanks. I will check the Robot module more carefully. dc
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: New Object Property: Material

Post by jriegel »

Ok,
and don't hesitate to write again if there is no solution for you. We surly can work out a solution.
Stop whining - start coding!
dchigrin
Posts: 76
Joined: Tue Dec 07, 2010 9:19 am
Location: Witten, Germany
Contact:

Re: New Object Property: Material

Post by dchigrin »

thank you :)
Post Reply