-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKnobs.py
77 lines (72 loc) · 2.56 KB
/
Knobs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#*****************************************************************************
#
# System :
# Module :
# Object Name : $RCSfile$
# Revision : $Revision$
# Date : $Date$
# Author : $Author$
# Created By : Robert Heller
# Created : Wed Dec 23 18:45:41 2020
# Last Modified : <230502.0859>
#
# Description
#
# Notes
#
# History
#
#*****************************************************************************
#
# Copyright (C) 2020 Robert Heller D/B/A Deepwoods Software
# 51 Locke Hill Road
# Wendell, MA 01379-9728
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
#
#*****************************************************************************
import Part
from FreeCAD import Base
import FreeCAD as App
import os
import sys
sys.path.append(os.path.dirname(__file__))
from LightSwitch import *
import datetime
class Grayhill_11K5019_JCNB(object):
_outerDia = 12.7
_height = 12.7
def __init__(self,name,origin):
self.name = name
if not isinstance(origin,Base.Vector):
raise RuntimeError("origin is not a Vector!")
self.origin = origin
self._body = Part.Face(Part.Wire(\
Part.makeCircle(self._outerDia/2.0,\
self.origin)))\
.extrude(Base.Vector(0,0,self._height))
shaft = Part.Face(Part.Wire(\
Part.makeCircle(Grayhill_56A36_01_1_04N.ShaftDiameter()/2.0,\
self.origin)))\
.extrude(Base.Vector(0,0,Grayhill_56A36_01_1_04N.ShaftLength()))
self._body = self._body.cut(shaft)
def show(self):
doc = App.activeDocument()
obj = doc.addObject("Part::Feature",self.name)
obj.Shape=self._body
obj.Label=self.name
obj.ViewObject.ShapeColor=tuple([0.0,0.0,0.0])