[RISOLTO]Animation Workbench

Forum per le domande e le discussioni in Italiano
Forum rules
regole del forum e le informazioni utili

Importante: PRIMA di chiedere aiuto leggete qui!
MarcoS.
Posts: 18
Joined: Wed Jun 15, 2022 6:56 pm
Location: Matera

[RISOLTO]Animation Workbench

Post by MarcoS. »

Salve a tutti ragazzi, sono nuovo qui e scusatemi se sbaglio qualcosa.
Devo fare un animazione. Vi allego un immagine così che tutto sia più chiaro.
Immagine 2022-06-15 210739.png
Immagine 2022-06-15 210739.png (301.81 KiB) Viewed 1937 times
Allora, il centro del triangolo ruota seguendo il cerchio, però io vorrei sapere quale percorso eseguono gli spigoli del triangolo.
Non c'è un comando che traccia il percorso degli spigoli di quel triangolo?
Grazie!
Last edited by MarcoS. on Sun Jun 19, 2022 10:42 am, edited 1 time in total.
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: Animation Workbench

Post by mario52 »

Hi
MarcoS. wrote: Wed Jun 15, 2022 7:14 pm sono nuovo qui e scusatemi se sbaglio qualcosa.
si questo e forum Inglese the italian forum is below
MarcoS. wrote: Wed Jun 15, 2022 7:14 pm Non c'è un comando che traccia il percorso degli spigoli di quel triangolo?
use Draft_PathArray Image

select the array and launch this macro for create on point in extremity of triangle (paste in the Python console)
(you can uncomment the lines (delete the # ))

Code: Select all

import Draft, Part
import FreeCADGui
from FreeCAD import Base
Gui=FreeCADGui

sel = Gui.Selection.getSelection()
for i in sel[0].Shape.Edges:
#    print(i.Vertexes[0].Point) # first point of edge
#    print(i.Vertexes[0].Point) # second point of edge
    point = Draft.make_point(i.Vertexes[0].Point) # first point of edge
#    point = Draft.make_point(i.Vertexes[1].Point) # second point of edge
trianglePoints00.png
trianglePoints00.png (13 KiB) Viewed 1891 times

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Animation Workbench

Post by Zolko »

MarcoS. wrote: Wed Jun 15, 2022 7:14 pm Allora, il centro del triangolo ruota seguendo il cerchio, però io vorrei sapere quale percorso eseguono gli spigoli del triangolo.
se il triangolo è in traslazione circulare, TUTTI i punti descrivono la stessa circonferenza. È matematico, non c'è bisogno di FreeCAD.
try the Assembly4 workbench for FreCAD — tutorials here and here
MarcoS.
Posts: 18
Joined: Wed Jun 15, 2022 6:56 pm
Location: Matera

Re: Animation Workbench

Post by MarcoS. »

Zolko wrote: Thu Jun 16, 2022 1:05 pm
MarcoS. wrote: Wed Jun 15, 2022 7:14 pm Allora, il centro del triangolo ruota seguendo il cerchio, però io vorrei sapere quale percorso eseguono gli spigoli del triangolo.
se il triangolo è in traslazione circulare, TUTTI i punti descrivono la stessa circonferenza. È matematico, non c'è bisogno di FreeCAD.
Purtroppo non è così perchè il triangolo oltre a ruotare su se stesso, percorre anche la circonferenza.
MarcoS.
Posts: 18
Joined: Wed Jun 15, 2022 6:56 pm
Location: Matera

Re: Animation Workbench

Post by MarcoS. »

mario52 wrote: Thu Jun 16, 2022 12:27 pm Hi
MarcoS. wrote: Wed Jun 15, 2022 7:14 pm sono nuovo qui e scusatemi se sbaglio qualcosa.
si questo e forum Inglese the italian forum is below
MarcoS. wrote: Wed Jun 15, 2022 7:14 pm Non c'è un comando che traccia il percorso degli spigoli di quel triangolo?
use Draft_PathArray Image

select the array and launch this macro for create on point in extremity of triangle (paste in the Python console)
(you can uncomment the lines (delete the # ))

Code: Select all

import Draft, Part
import FreeCADGui
from FreeCAD import Base
Gui=FreeCADGui

sel = Gui.Selection.getSelection()
for i in sel[0].Shape.Edges:
#    print(i.Vertexes[0].Point) # first point of edge
#    print(i.Vertexes[0].Point) # second point of edge
    point = Draft.make_point(i.Vertexes[0].Point) # first point of edge
#    point = Draft.make_point(i.Vertexes[1].Point) # second point of edge

trianglePoints00.png


mario
Ciao Mario, la soluzione che mi hai proposto è molto interessante, però non riesco ad eseguire la macro, non esegue niente. L'errore è:

Traceback (most recent call last):
File "<input>", line 4, in <module>
AttributeError: module 'Draft' has no attribute 'make_point'

Come lo risolvo?
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: Animation Workbench

Post by mario52 »

Saluti

@chrisb please move to the Italian forum thanks
MarcoS. wrote: Thu Jun 16, 2022 5:01 pm File "<input>", line 2
point = Draft.make_point(i.Vertexes[0].Point)
^
IndentationError: expected an indented block

Come lo risolvo?
deve essere cosi

Code: Select all

import Draft, Part
import FreeCADGui
from FreeCAD import Base
Gui=FreeCADGui

sel = Gui.Selection.getSelection()
for i in sel[0].Shape.Edges:
    print(i.Vertexes[0].Point) # first point of edge
    print(i.Vertexes[0].Point) # second point of edge
    point = Draft.make_point(i.Vertexes[0].Point) # first point of edge
    point = Draft.make_point(i.Vertexes[1].Point) # second point of edge
non toccare alo spaccio solo lo # (uno spaccio fa corpo con il codice molto importante si no ... fa : IndentationError: expected an indented block

la macro non fa animatione crea justo i punti al posto "Vertex" del obbietto seleto
MarcoS. wrote: Thu Jun 16, 2022 4:56 pm Purtroppo non è così perchè il triangolo oltre a ruotare su se stesso, percorre anche la circonferenza.
non sapevo che il triangolo girava, deve girare come ? quante imagine (per i gradi)

l’animatione e importante ? si no invece di usare Draft_PathArray usate Draft_CircularArray Image o Draft_PolarArray Image

altre macro:

Macro_Animator Image

Macro_Rotate_To_Point Image salva le coordinate e crea una macro per fare una animatione , dovete tutto fare (movimenti) una per una

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
MarcoS.
Posts: 18
Joined: Wed Jun 15, 2022 6:56 pm
Location: Matera

Re: Animation Workbench

Post by MarcoS. »

@chrisb please move to the Italian forum thanks
How to move to the italian forum?
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Animation Workbench

Post by openBrain »

MarcoS. wrote: Thu Jun 16, 2022 6:37 pm How to move to the italian forum?
Done ;)
MarcoS.
Posts: 18
Joined: Wed Jun 15, 2022 6:56 pm
Location: Matera

Re: Animation Workbench

Post by MarcoS. »

openBrain wrote: Thu Jun 16, 2022 6:55 pm
MarcoS. wrote: Thu Jun 16, 2022 6:37 pm How to move to the italian forum?
Done ;)
By the way, i try to rotate the triangle on itself while it follow the circle. But i need to know the track of triangle's corners. How can i do it?
P.S. Sorry for my bad english.
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Animation Workbench

Post by onekk »

Ciao non e chiaro in che modo deve ruotare il triangolo rispetto alla rotazione attorno al cerchio.

ad esempio per ogni grado di rotazione attorno al cerchio il tringolo deve ruotare (senso orario o antiorario) di x gradi.

All'incirca così si può pensare di creare una rotazione.

Sul come ci sono varie tecniche al limite anche la creazione di un gif animato usando una serie di "fotogrammi" creati con FC.

Saluti

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
Post Reply