FreeCAD Logo FreeCAD 1.0
  • Angličtina Afrikánština Arabština Běloruština Katalánština Čeština Němčina Řečtina Španělština Španělština Baskičtina Finština Filipínština Francouzština Galicijština Chorvatština Maďarština Indonéština Italština Japonština Kabylština Korejština Litevština Holandština Norština Bokmål Polština Portugalština Portugalština Rumunština Ruština Slovenština Slovinština Srbština Švédština Turečtina Ukrajinština Valencijština Vietnamština Čínština Čínština
  • Funkce
  • Stáhnout
  • Blog
  • Dokumentace
    Hlavní strana dokumentace Začínáme Uživatelská dokumentace Příručka FreeCAD Dokumentace pracovních prostředí Dokumentace o skriptování v Pythonu Dokumentace o programování v C++ Tutoriály Často kladené otázky Zásady ochrany soukromí O FreeCADu
  • Zapojte se
    Jak pomoci Sponsor Nahlásit chybu Vytvořit žádost o změnu Pracovní místa a financování Pokyny pro příspěvky Příručka pro vývojáře Překlady
  • Komunita
    Etický kodex Fórum The FPA GitHub GitLab Codeberg Mastodon Matrix IRC IRC via Webchat Gitter Discord Reddit Twitter Facebook LinkedIn Kalendář
  • ♥ Donate

Donate

$
SEPA informace
Nastavte prosím Váš SEPA bankovní převod na:
Beneficiary: The FreeCAD project association
IBAN: BE04 0019 2896 4531
BIC/SWIFT: GEBABEBBXXX
Bankovní agentura: BNP Paribas Fortis
Adresa: Rue de la Station 64, 1360 Perwez, Belgium

While Stripe doesn't support monthly donations, you can still become a sponsor! Simply make a one-time donation equivalent to 12 months of support, and you'll gain access to the corresponding sponsoring tier. It's an easy and flexible way to contribute.

If you are not sure or not able to commit to a regular donation, but still want to help the project, you can do a one-time donation, of any amount.

Choose freely the amount you wish to donate one time only.

You can support FreeCAD by sponsoring it as an individual or organization through various platforms. Sponsorship provides a steady income for developers, allowing the FPA to plan ahead and enabling greater investment in FreeCAD. To encourage sponsorship, we offer different tiers, and unless you choose to remain anonymous, your name or company logo will be featured on our website accordingly.

from 1 USD / 1 EUR per month. You will not have your name displayed here, but you will have helped the project a lot anyway. Together, normal sponsors maintain the project on its feet as much as the bigger sponsors.

from 25 USD / 25 EUR per month. Your name or company name is displayed on this page.

from 100 USD / 100 EUR per month. Your name or company name is displayed on this page, with a link to your website, and a one-line description text.

from 200 USD / 200 EUR per month. Your name or company name and logo displayed on this page, with a link to your website and a custom description text. Companies that have helped FreeCAD early on also appear under Gold sponsors.

Instead of donating each month, you might find it more comfortable to make a one-time donation that, when divided by twelve, would give you right to enter a sponsoring tier. Don't hesitate to do so!

Choose freely the amount you wish to donate each month.

Please inform your forum name or twitter handle as a notein your transfer, or reach to us, so we can give you proper credits!

Scriptované objekty
Pivy
Index

Úvod

The geometry that appears in the 3D views of FreeCAD is rendered by the Coin3D library. Coin3D is an implementation of the Open Inventor standard. The OpenCASCADE software also provides the same functionality, but it was decided at the very early stages of FreeCAD not to use the built-in OpenCASCADE viewer, but rather switch to the more performant Coin3D software. A good way to learn about that library is the book Open Inventor Mentor.

Description

Open Inventor is a 3D scene description language. The scene described in Open Inventor is then rendered in OpenGL on your screen. Coin3D takes care of doing this, so programmers do not need to deal with complex OpenGL calls, and may just provide valid Open Inventor code. The big advantage is that Open Inventor is a very well-known and well documented standard.

One of the big jobs FreeCAD does for you is translating OpenCASCADE geometry information into Open Inventor language.

Open Inventor describes a 3D scene in the form of a scene graph, like the one below:

Image taken from Inventor mentor

An Open Inventor scenegraph describes everything that is part of a 3D scene, such as geometry, colors, materials, lights, etc, and organizes all that data in a convenient and clear structure. Everything can be grouped into sub-structures, allowing you to organize your scene contents pretty much the way you like. Here is an example of an Open Inventor file:

#Inventor V2.0 ascii
 
Separator { 
    RotationXYZ {	
       axis Z
       angle 0
    }
    Transform {
       translation 0 0 0.5
    }
    Separator {	
       Material {
          diffuseColor 0.05 0.05 0.05
       }
       Transform {
          rotation 1 0 0 1.5708
          scaleFactor 0.2 0.5 0.2
       }
       Cylinder {
       }
    }
}

As you can see, the structure is very simple. You use separators to organize your data into blocks, a bit like you would organize your files into folders. Each statement affects what comes next, for example the first two items of our root separator are a rotation and a translation, both will affect the next item, which is a separator. In that separator a material is defined and another transformation. Our cylinder will therefore be affected by both transformations, the one applied directly to it and the one that was applied to its parent separator.

We also have many other types of elements to organize our scene, such as groups, switches or annotations. We can define very complex materials for our objects, with colors, textures, shading modes and transparency. We can also define lights, cameras, and even movement. It is even possible to embed pieces of scripting in Open Inventor files to define more complex behaviors.

If you are interested in learning more about Open Inventor head directly to its most famous reference: the Inventor mentor.

In FreeCAD, normally, we don't need to interact directly with the Open Inventor scenegraph. Every object in a FreeCAD document, being a mesh, a part shape or anything else, gets automatically converted to Open Inventor code and inserted in the main scenegraph that you see in a 3D view. That scenegraph gets updated continuously when you modify, add or remove objects. In fact every object (in App space) has a view provider (a corresponding object in Gui space) responsible for issuing Open Inventor code.

But there are many advantages to being able to access the scenegraph directly. For example, we can temporarily change the appearance of an object, or we can add objects to the scene that have no real existence in the FreeCAD document, such as construction geometry, helpers, graphical hints or tools such as manipulators or on-screen information.

FreeCAD itself features several tools to see or modify Open Inventor code. For example, the following Python code will show the Open Inventor representation of a selected object:

obj = FreeCAD.ActiveDocument.ActiveObject
viewprovider = obj.ViewObject
print viewprovider.toString()

But we also have a Python module that allows complete access to anything managed by Coin3D, such as our FreeCAD scenegraph. So, read on to Pivy.

Coding examples

See Coin3d snippets courtesy of MariwanJ's research for the Design456 Workbench. The code repository can be found at https://github.com/MariwanJ/COIN3D_Snippet.

Top

Scriptované objekty
Pivy
Index

Tato stránka je načtena z https://wiki.freecad.org/Scenegraph

Buďte v kontaktu!
Forum GitHub Mastodon Matrix IRC Gitter.im Discord Reddit Twitter Facebook LinkedIn

© Tým FreeCAD. Autorství obrázků úvodní stránky (od zhora dolů): ppemawm, r-frank, epileftric, regis, rider_mortagnais, bejant.

Tento projekt podporují: , KiCad Services Corp. a ostatní sponzoři

GitHubVylepšete tuto stránku na GitHubu