Macro Ellipse-Center+2Points/cs: Difference between revisions
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
Line 1: | Line 1: | ||
<languages/> |
<languages/> |
||
<div class="mw-translate-fuzzy"> |
|||
{{Macro/cs|Icon=Text-x-python|Name=Macro_Ellipse-Center+2Points|Name/cs=Ellipse Center+2Points|Description=Vytvoří elipsu výběrem 3 bodů (v tomto pořadí): střed, velký poloměr, malý poloměr|Author=Eriossoltero|Version=01.00|Date=2016-12-25}} |
{{Macro/cs|Icon=Text-x-python|Name=Macro_Ellipse-Center+2Points|Name/cs=Ellipse Center+2Points|Description=Vytvoří elipsu výběrem 3 bodů (v tomto pořadí): střed, velký poloměr, malý poloměr|Author=Eriossoltero|Version=01.00|Date=2016-12-25}} |
||
</div> |
|||
<div class="mw-translate-fuzzy"> |
<div class="mw-translate-fuzzy"> |
||
Vytvoří elipsu výběrem 3 bodů (v tomto pořadí): střed, velký poloměr, malý poloměr |
Vytvoří elipsu výběrem 3 bodů (v tomto pořadí): střed, velký poloměr, malý poloměr |
||
</div> |
</div> |
||
[[Image:EllipseCenter2Point.png]] |
[[Image:EllipseCenter2Point.png]] |
||
{{clear}} |
|||
==Script== |
==Script== |
Revision as of 14:09, 12 December 2018
File:Text-x-python Macro_Ellipse-Center+2Points |
Popis |
---|
Vytvoří elipsu výběrem 3 bodů (v tomto pořadí): střed, velký poloměr, malý poloměr Version macro : 01.00 Date last modification : 2016-12-25 Autor: Eriossoltero |
Autor |
Eriossoltero |
Download |
None |
Odkazy |
Makro recepty| Jak nainstalovat makra Jak přizpůsobit panely nástrojů |
Verze |
01.00 |
Datum poslední úpravy |
2016-12-25 |
Verze FreeCAD |
None |
Výchozí zástupce |
None |
Viz též |
None |
Vytvoří elipsu výběrem 3 bodů (v tomto pořadí): střed, velký poloměr, malý poloměr
Script
Macro_EllipseCenter2Points.FCMacro
# Macro Begin: Ellipse-Center+2Points.FCMacro +++++++++++++++++++++++++++++++++++++++++++++++++
# http://freecad-tutorial.blogspot.com/2011/12/engine-9-poly-v-belt.html
import Part, FreeCAD, math, PartGui, FreeCADGui
from FreeCAD import Base
# get the selected objects, with first selection for the trajectory and second for the section
# Adapted from:
# http://freecad-tutorial.blogspot.com/2011/12/engine-9-poly-v-belt.html
s = FreeCADGui.Selection.getSelection()
try:
sel1=s[0].Shape
sel2=s[1].Shape
sel3=s[2].Shape
except:
print "Wrong selection"
pt_center = sel1.Point
pt_radmay = sel2.Point
pt_radmen = sel3.Point
# create Part object in the current document
myObject=App.ActiveDocument.addObject("Part::Feature","Ellipse")
# create a shape and assign it to the current document
ellipse = Part.Ellipse(pt_radmay, pt_radmen, pt_center)
myObject.Shape = ellipse.toShape()
# Macro End: Ellipse-Center+2Points.FCMacro +++++++++++++++++++++++++++++++++++++++++++++++++