Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jmwright's full-sized avatar

Jeremy Wright jmwright

View GitHub Profile
@jmwright
jmwright / png_export_from_cadquery_using_vtk.py
Last active April 22, 2024 15:37
Exports a CadQuery Model or Assembly to a PNG Image
from math import degrees
from vtkmodules.vtkRenderingCore import vtkGraphicsFactory
from vtkmodules.vtkCommonColor import vtkNamedColors
from vtkmodules.vtkRenderingCore import (
vtkActor,
vtkPolyDataMapper as vtkMapper,
vtkRenderer
)
from vtkmodules.vtkRenderingCore import vtkRenderWindow, vtkRenderWindowInteractor, vtkWindowToImageFilter
from vtkmodules.vtkFiltersExtraction import vtkExtractCellsByType
@jmwright
jmwright / exsource_def.yml
Created December 4, 2023 15:49
CadScript ExSource Integration
exports:
rack_leg:
name: rack_leg
description: >
Rack Leg
output-files:
- ./rack_leg.stl
source-files:
- ./nimble_rack_leg.py
parameters:
@jmwright
jmwright / freecad_import_in_cadquery.py
Last active December 12, 2023 15:03
FreeCAD Import in CadQuery
import os, sys
import glob
import zipfile
import tempfile
import cadquery as cq
def _fc_path():
"""
Pulled from cadquery-freecad-module
@jmwright
jmwright / cadquery_hylang_example.hy
Last active December 5, 2023 20:53
Example of Creating a CadQuery Object With the Hylang Lisp Dialect
#!/usr/bin/env hy
; A port of the CadQuery example here: https://github.com/CadQuery/cadquery/blob/master/examples/Ex100_Lego_Brick.py
; Information about the Hylang Lisp dialect: http://hylang.org/
(import cadquery :as cq)
(import cadquery.vis [show])
; User parameters
(setv lbumps 2) ; number of bumps long
from OCP.Quantity import Quantity_Color, Quantity_TOC_RGB
from OCP.TopoDS import TopoDS_Compound
from OCP.STEPControl import STEPControl_Writer, STEPControl_AsIs
from OCP.BRep import BRep_Tool, BRep_Builder
from OCP.TCollection import TCollection_ExtendedString
from OCP.TDocStd import TDocStd_Application, TDocStd_Document
from OCP.XCAFDoc import XCAFDoc_DocumentTool, XCAFDoc_ColorType, XCAFDoc_ColorGen
from OCP.STEPCAFControl import STEPCAFControl_Writer
from OCP.XSControl import XSControl_WorkSession
from OCP.TDataStd import TDataStd_Name
package main
import "core:log"
import "core:runtime"
import gl "vendor:OpenGL"
// import glfw "shared:odin-glfw"
import "vendor:glfw"
DESIRED_GL_MAJOR_VERSION :: 4;
DESIRED_GL_MINOR_VERSION :: 5;
@jmwright
jmwright / cadquery_tips_and_tricks.md
Last active January 31, 2024 13:39
CadQuery Tips and Tricks

1. Conda Installation

If you use conda you might try creating a new environment and install using conda directly:

  conda create -n cadquery-master
  conda install -c cadquery -c conda-forge cadquery=master

Or if you want both cq-editor and cadquery:

  conda create -n cqgui-master
  conda install -c cadquery -c conda-forge cq-editor=master
@jmwright
jmwright / rockpro64_setup.md
Last active July 22, 2020 21:19
Getting a RockPro64 ARM Board Up and Running

This information is now outdated. I was not able to get any images running 5.4 kernels to work, but images with the 4.4 kernel work just fine.

Installation

I was only able to get one Ubuntu/Debian image out of all of them from the Rock64 wiki to work, and it was a minimal Debian image with a kernel tailored for media uses. According to what I saw on the forums, I'm not the only person with this issue. Big thanks to @mrfixit2001 for making that one working image available.

This is the process I went through to get things to work.

  • Download the RockPro64 image from here.
  • Use Etcher or the xz command to write that to an (>=4 GB) SD card. Note that the Rock64 boards are known to be finicky about SD cards.

WIP Installation Instructions for pywrap on Raspberry Pi

Pre-requisites

  • pip3 install logzero toml pandas joblib path tqdm toposort clang pybind11 cymbal schema

Script alterations

  • Change run.sh script python references to python3

Run the generation script

CONDA_PREFIX="." ./run.sh

@jmwright
jmwright / sliderule_local_demo_setup.md
Last active November 22, 2018 11:39
Using the git daemon to set up a demo on a local system

Intro

This assumes a Linux system. Adapt as needed for Windows.

Prerequisites

Note that most of this may be superceeded if a repo is created holding all the proper demo directory structure.

  1. Create a blank demo directory to be the root directory and cd into it: mkdir demo && cd demo
  2. Initialize the directory as a blank git repository: git init
  3. Follow steps 1 and 2 for the component you want to create.
  4. Make sure to cd back into the root demo directory before executing the next step.
  5. Make sure to have git installed. Then run the following command.