Skip to content

Instantly share code, notes, and snippets.

View fragmuffin's full-sized avatar

Peter Boin fragmuffin

  • Melbourne, Australia
  • 12:22 (UTC +10:00)
View GitHub Profile
@fragmuffin
fragmuffin / base-slot1.gcode
Created July 27, 2017 13:32
gcode file failing on my cnc miller
T5
G17
G21
G90
S7000
M03
G00 Z5
G00 X9.602 Y48.74
G00 Z2
F100
@fragmuffin
fragmuffin / pulley.png
Last active August 27, 2017 11:37
cadquery implementation of a basic pulley
pulley.png
@fragmuffin
fragmuffin / layer_cake.png
Last active August 28, 2017 02:43
cadquery layer cake example of unwanted changes
layer_cake.png
@fragmuffin
fragmuffin / intersection_example.py
Last active September 9, 2017 15:32
CadQuery intersection workaround
import cadquery as cq
from Helpers import show
# remake of the wikiedia example of a CSG intersect:
# https://en.wikipedia.org/wiki/Constructive_solid_geometry#Workings
sphere = cq.Workplane("XY").sphere(7.5).translate((5, 5, 5))
box = cq.Workplane("XY").box(10, 10, 10)
def copy(obj):
@fragmuffin
fragmuffin / foo.py
Created September 12, 2017 10:35
`cadquery` CSG Operation Registration experiment
#!/usr/bin/python
import six
from collections import defaultdict
# ================= LIBRARY CODE =================
# ---- Registration
registered_operations = defaultdict(dict)
def register(obj_type, name, keys=('result',)):
assert issubclass(obj_type, ObjectType), "bad object type: %r" % obj_type
assert isinstance(name, six.string_types), "bad name: %r" % name
@fragmuffin
fragmuffin / cadquery_thread.py
Last active September 18, 2017 12:32
CadQuery thread (method not recommended)
import cadquery
from Helpers import show
helical_radius = 6.0
core_radius = 4.0
pitch = 2.0 # length per revolution
length = 12.0
def helical_path(p, l, r):
wire = cadquery.Wire.makeHelix(p, l, r, angle=0)
@fragmuffin
fragmuffin / freecad_makethread_test.py
Last active September 19, 2017 12:58
FreeCAD Part.makeThread result in cadquery
import cadquery as cq
from Helpers import show
import Part
pitch = 2
depth = 1
height = 10
radius = 2
@fragmuffin
fragmuffin / dynamic_proxy_test.py
Created October 8, 2017 01:19
dynamic proxy for wrapped instances
#!/usr/bin/env python
class BaseVector(object):
def cross(self, v):
print("base vector cross")
def dot(self, v):
print("base vector dot")
@fragmuffin
fragmuffin / .gitignore
Last active May 21, 2024 15:59
python unittest skip by label
__pycache__
@fragmuffin
fragmuffin / cube.bin
Last active February 9, 2018 11:42
cqparts exported glTF examples