Giter Site home page Giter Site logo

Link's Shape property about freecad HOT 5 OPEN

realthunder avatar realthunder commented on August 27, 2024
Link's Shape property

from freecad.

Comments (5)

realthunder avatar realthunder commented on August 27, 2024

Can you please post a file showing the wrong shape?

from freecad.

abetis avatar abetis commented on August 27, 2024

Hmm... I'm trying to find the file where I saw the problem, but can't reproduce it.
I've used many old tutorial files, which probably were created with some old or custom build versions.
Will keep an eye on that and report if I'll see it again.

Anyway, the "Shape" property is not listed for Link object in the console, while it is accessible.

And something I want to confirm:
Does the link attachment offsets are applied to the Shape information as well?
I mean, if an object has offset of 100mm on X axis, will the Center of BoundBox have that offset as well?

from freecad.

abetis avatar abetis commented on August 27, 2024

Here... Found it...
test.zip
Open the test1.FCStd file, it have a link to goTUBE 336mm.FCStd
The goTUBE 336mm.FCStd file was created with imported STEP.

Send "goTUBE 336mm.FCStd" entry from the tree to Python console

>>> obj.Shape.BoundBox
BoundBox (-15.8585, -1e+100, -15.975, 15.8585, 1e+100, 15.975)

Send "goTUBE 336mm.FCStd" entry from the tree to Python console

>>> obj.Shape.BoundBox
BoundBox (-15.8585, 0, -15.975, 15.8585, 336, 15.975)

from freecad.

realthunder avatar realthunder commented on August 27, 2024

What did your second obj.Shape.Boundbox refer to? I think you made a typo. Are you referring to the tube model? The Link to model gives the compound of all its children shape, including those datum lines.

Anyway, the "Shape" property is not listed for Link object in the console, while it is accessible.

It is not listed because it is not a real FreeCAD property. It is actually implemented as a Python attribute. It is dynamically calculated by calling Part.getShape(). In other words, getattr(link, 'Shape') is equivalent to Part.getShape(link). And yes, it will adjust the returned shape's placement according to the link placement.

The same things goes for App.Part, i.e. getattr(part, 'Shape') is equivalent to Part.getShape(part), which returns a compound of its children in part's placement.

from freecad.

abetis avatar abetis commented on August 27, 2024

What did your second obj.Shape.Boundbox refer to? I think you made a typo. Are you referring to the tube model? The Link to model gives the compound of all its children shape, including those datum lines.

Sorry, copy&paste didn't work when typing...
I meant goTUBE_336mm link and "4103-0032-0336" body of the object.

So, based on your answer, Shape is not relevant for Assembly4 since its using FC's elements that define an object such as line... That might be a problem on the long run if Assembly4 will become popular...

Anyway, the "Shape" property is not listed for Link object in the console, while it is accessible.

It is not listed because it is not a real FreeCAD property. It is actually implemented as a Python attribute. It is dynamically calculated by calling Part.getShape(). In other words, getattr(link, 'Shape') is equivalent to Part.getShape(link). And yes, it will adjust the returned shape's placement according to the link placement.

I'm not familiar with the code that much, but I as saw, Visibility is also an attribute that run show/hide functions based on the call, but it's still shown in the python console.

from freecad.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.