Files
create/src/Mod/Draft/draftobjects/polararray.py
vocx-fc 1336381eec Draft: new command for Draft PolarArray
Added object, viewprovider, icon; gui command definition, task panel,
add command to InitGui; add callbacks, and delay system.
2020-01-07 07:18:39 -03:00

43 lines
2.2 KiB
Python

"""This module provides the object code for Draft PolarArray.
"""
## @package polararray
# \ingroup DRAFT
# \brief This module provides the object code for Draft PolarArray.
# ***************************************************************************
# * (c) 2019 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU Lesser General Public License (LGPL) *
# * as published by the Free Software Foundation; either version 2 of *
# * the License, or (at your option) any later version. *
# * for detail see the LICENCE text file. *
# * *
# * FreeCAD is distributed in the hope that it will be useful, *
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
# * GNU Library General Public License for more details. *
# * *
# * You should have received a copy of the GNU Library General Public *
# * License along with FreeCAD; if not, write to the Free Software *
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
# * USA *
# * *
# ***************************************************************************
import FreeCAD as App
import Draft
def make_polar_array(obj,
center=App.Vector(0, 0, 0), angle=180, number=4,
use_link=False):
"""Create a polar array from the given object.
"""
obj = Draft.makeArray(obj,
arg1=center, arg2=angle, arg3=number,
useLink=use_link)
return obj