Sketcher Examples/pl

Wprowadzenie
Myślę, że środowisko pracy Szkicownik potrzebuje kilku przykładów, które nie są szczegółowymi poradnikami czy filmikami ...



Zawias zwijany
Zawias zwijany to niewielki kawałek zginanego tworzywa sztucznego, który łączy dwie strony przedmiotu formowanego wtryskowo, np. przepustu z pokrywą lub obu połówek obudowy wtyczki chroniącej przed kurzem.

Ten przykład wykorzystuje pewien rodzaj szkicu głównego, na którym umieszcza się kilka zależnych od niego szkiców. Pokazuje również jak dołączyć i animować prosty zacisk wykonany na funkcjach środowiska pracy Projekt Części oraz  Szkicownik z wiązaniami. Zastosowanie wyrażeń w sposób opisany poniżej wymaga programu FreeCAD w wersji 0.21 lub nowszego.



Podstawowy szkic
Zwykle obiekt jest modelowany w stanie zamkniętym. Później ruchoma część musi zostać odwrócona o 180°, aby uformować ją w stanie otwartym. Zginany pasek jest reprezentowany przez okrągły łuk dla stanu zamkniętego i linię prostą dla stanu otwartego, oba mające ten sam punkt początkowy. Punkt środkowy linii łączącej oba punkty końcowe wskazuje położenie osi odwracania, która jest normalna do płaszczyzny szkicu. (Jest umieszczony na początku szkicu, dzięki czemu globalna oś prostopadła do płaszczyzny szkicu może być użyta jako oś odwracania)

(Niektóre ukryte dodatkowe wyjaśnienia i opis przepływu pracy można rozwinąć tutaj -->



For a semi circle, the arc length is the radius multiplied by Pi (l = r * Pi). The radius is named NeutralRadius and the line is called DevelopedLength. An expression for the DevelopedLength relates both values:
 * Within the same sketch an expression starts with a followed by ValueType.ValueName to address another value.

Intermediate sketch
The arc of this film hinge has a constant length and a variable radius. One input is the NeutralRadius of the basic sketch; to have it at hand in this sketch, it is linked as external geometry having a reference dimension called ReferenceRadius

A pie segment of construction geometry displays the relation between the arc and the radius for a given angle. InputLength = ReferenceRadius * Pi and ArcLength = DynamicRadius * Pi * ArcAngle / 180° with constant length results in: ReferenceRadius * Pi = DynamicRadius * Pi * ArcAngle / 180° And with Pi eliminated we get: ReferenceRadius = DynamicRadius * ArcAngle / 180° or DynamicRadius  = ReferenceRadius  * 180° / ArcAngle
 * The [[Image:Bound-expression.svg|16px]] expression for the DynamicRadius value:

A film hinge is usually symmetric and so another arc with the same center point called HalfArc is used for the output and represents one half of the hinge arc.
 * The [[Image:Bound-expression.svg|16px]] expression for the HalfArc value:



Film hinge sketch
This sketch defines the thickness and the adjacent geometry of the film hinge. Therefore we load the half arc of the intermediate sketch as external geometry to use it as the base for the film part. (a fraction of 180° in this case)

This film hinge is intended to keep the connected parts touching each other when closed. This can be achieved by calculating a circular arc of the needed length then create a strip with constant thickness and finally apply fillets where the strip meets the object halves. The last step somehow shortens the loop, but in the real world this is not a problem, because the arc will never be circular and so the fillets have an influence on the arc's curvature but not on its functionality.







Hint: Part Mirror only accepts the three basic planes  and so can not be used in such a  case.
 * (In retrospect it was a wise decision to start this example with the combination of PartDesign and Sketcher.)

Finally two parameters define the size of the film hinge:
 * the NeutralRadius of the basic sketch
 * the thickness value of the intermediate sketch

Bending the film hinge
The bend angle is controlled by the constraint ArcAngle of the intermediate sketch and can be altered in its property editor. But we are proper designers and have named our sketches constraints and dimensions properly and so can address the controlling angle via Python. Some basic lines of code to be embedded in a GUI context could look like this:

A short explanation:
 * : To address the active document by an alias called doc
 * To address the relevant sketch by the alias sketch.
 * The method getObjectsByLabel returns a list of objects and we have to suffix index to pick the first object in the list. (We do not expect any other object having the same label and so do not have to care about other items in the list.)
 * : Returns the current value of the dimensional constraint ArcAngle (to the Report view)
 * : Sets the value of ArcAngle to
 * : To update the whole document to show the changes of dependant geometry as well.



Geometria łącząca
Dwie połówki zacisku czekają na przymocowanie do zawiasu, jedna po stronie statycznej, druga po stronie ruchomej.



Strona statyczna jest łatwa:
 * 1) Aktywuj zawartość i dostosuj właściwości pozycji i orientacji w edytorze właściwości, aż będzie pasował do zawiasu zwijanego.
 * 2) Aktywuj zawartość zawiasu.
 * 3) Wybierz [[Image:PartDesign_Boolean.svg|16px]] Operacje logiczne narzędzie z (domyślną) opcją Scalenie.
 * 4) W oknie dialogowym naciśnij przycisk
 * 5) wybierz ciało statycznej połowy klipu.
 * 6) Naciśnij OK, aby zakończyć i zamknąć okno dialogowe.



But the moving side is different: The related half of the clip geometry has to move into the right position before a (re-) calculation of a Fuse operation gets started.

At this point I'm missing an "Attachment with offset" function like that of Assembly3 to attach the clip geometry to one of the moving faces. But after a bit of experimenting and tweaking I found out:


 * [[Image:Std_Part.svg|16px]] Std Part and [[Image:PartDesign_Body.svg|16px]] PartDesign Body containers are not supported by [[Image:Part_EditAttachment.svg|16px]] Part Attachment.
 * While it is possible to use Attachment to align them, the attachment won't be parametrically linked.


 * Attachment can be applied to a PartDesign feature. This and features depending on it are repositioned according to the base geometry. But!:
 * Independent PartDesign features won't move and so it will change the resulting shape and break it in the end.
 * We are advised to keep features independent to avoid impacts due to the Topological naming problem.
 * PartDesign_Clone.svg PartDesign Clone creates a body with a single feature that can be use with Attachment.

With that in mind, a workflow could look like this:


 * 1) Select the body of the movable half.
 * 2) Use the PartDesign_Clone.svg Create a clone command.
 * 3) In the new body select the Clone object in the Tree view.
 * 4) Use the [[Image:Part_EditAttachment.svg|16px]] Part Attachment tool to add attachment properties to the Clone object.
 * 5) The Attachment dialog opens.
 * 6) * Select a vertex for the origin.
 * 7) * Select an edge for the first direction.
 * 8) * Select an edge for the second direction.
 * 9) * Probe the attachment modes to find the best fitting one.
 * 10) * Tweak rotation and coordinate values until until the geometry is in modelling position again.
 * 11) Press OK to close the dialog.
 * 12) With the hinge body still active select the [[Image:PartDesign_Boolean.svg|16px]] PartDesign Boolean tool.
 * 13) In the dialog press the  button.
 * 14) select the body of the movable half.
 * 15) Press OK to finish and close the dialog.



In retrospect it would have been wiser to provide the attachment geometry with the IntermediateSketch to avoid another source of the Topological naming problem.



Now the result should be a single solid clip, that can be closed and opened by changing the ArcAngle of the film hinge. Allowed angles: 0.1° to 180°, the film section must not get straight, and more than closed doesn't make sense. (At 180° the object may get fused at tangent or overlapping areas, but a little extra gap could help if that is not acceptable.)