poc/examples/example.poc
2017-08-05 21:25:14 -05:00

34 lines
1.2 KiB
Text
Executable file

#!/usr/bin/env poc
# -*- coding: utf-8 -*-
# Simple example for 'poc' modeling program
# Copyright © 2017 Jeff Epler <jepler@gmail.com>
#
# 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 3 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, see <http://www.gnu.org/licenses/>.
IN=25.4
dist = 12*IN
dia = .75*IN
od = dia + .25*IN
elevation = 1*IN
engagement = 1*IN
angle = atan2(elevation, dist)
with Intersection():
with Difference():
Cylinder((0,0,-elevation), (0,0,elevation+engagement), od/2)
Cylinder((0,0,elevation), (0,0,100), dia/2)
Rotate(angle, (1,0,0))
Box((-100,-100,0), (100,100,100))
Fillet(1)