Macro Geodesic Dome

From FreeCAD Documentation
Revision as of 16:48, 11 January 2015 by Ulrich1a (talk | contribs) (Adding the geodesic dome macro to the wiki)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

File:Text-x-python Macro_GeodesicDome

Description
This macro creates a geodesic dome

Author: Ulrich Brammer
Author
Ulrich Brammer
Download
None
Links
Macro Version
1.0
Date last modified
None
FreeCAD Version(s)
None
Default shortcut
None
See also
None

This macro creates a geodesic dome shell. The dome radius and the frequency parameter will be set at creation time.

File:Geodesic macro.png


# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'geodesic_dialog.ui'
# And changed manually to use FreeCAD "Gui::InputField"
# Created: Sun Jan  4 22:20:58 2015
#      by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# 
'''
************************************************************************
* Copyright (c)2015 Ulrich Brammer <ulrich1a[at]users.sourceforge.net> *
*                                                                      *
* This file is a supplement to 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.                                *
*                                                                      *
* This software 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 this macro; if not, write to the Free Software    *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 *
* USA                                                                  *
*                                                                      *
************************************************************************
'''


from PySide import QtCore, QtGui
import FreeCAD, FreeCADGui, math, Part
from FreeCAD import Base

class Ui_Dialog(object):
  def setupUi(self, Dialog):
    Dialog.setObjectName("Dialog")
    Dialog.resize(477, 188)
    self.dia = Dialog
    self.gridLayoutWidget = QtGui.QWidget(Dialog)
    self.gridLayoutWidget.setGeometry(QtCore.QRect(19, 19, 440, 141))
    self.gridLayoutWidget.setObjectName("gridLayoutWidget")
    self.gridLayout = QtGui.QGridLayout(self.gridLayoutWidget)
    self.gridLayout.setContentsMargins(0, 0, 0, 0)
    self.gridLayout.setObjectName("gridLayout")
    self.label = QtGui.QLabel(self.gridLayoutWidget)
    self.label.setObjectName("label")
    self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
    #self.lineEdit = QtGui.QLineEdit(self.gridLayoutWidget)
    fui = FreeCADGui.UiLoader()
    self.lineEdit = fui.createWidget("Gui::InputField")
    
    self.lineEdit.setObjectName("lineEdit")
    self.gridLayout.addWidget(self.lineEdit, 0, 1, 1, 1)
    self.label_2 = QtGui.QLabel(self.gridLayoutWidget)
    self.label_2.setObjectName("label_2")
    self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
    self.lineEdit_2 = QtGui.QLineEdit(self.gridLayoutWidget)
    self.lineEdit_2.setObjectName("lineEdit_2")
    self.gridLayout.addWidget(self.lineEdit_2, 1, 1, 1, 1)
    self.label_3 = QtGui.QLabel(self.gridLayoutWidget)
    self.label_3.setObjectName("label_3")
    self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1)
    self.buttonBox = QtGui.QDialogButtonBox(self.gridLayoutWidget)
    self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
    self.buttonBox.setStandardButtons \
      (QtGui.QDialogButtonBox.Cancel