Skip to content

Instantly share code, notes, and snippets.

View medicationforall's full-sized avatar

James Adams medicationforall

View GitHub Profile

Installing CadQuery on Windows

Install Python

  • https://www.python.org/
  • Make sure to set the path variable when installing on windows.
  • open a command line and run
python --version

Installing CQ-Editor with CadQuery 2 using pip

Pre-Requisites

  • python
  • pip
  • git
  • virtualenvwrapper (optional)

Steps

  • Create a virtual environment for CQ-Editor

CadQuery Python Packaging - Making your own library

Probably an advanced topic

Goal of the video

Show you how to make your own python package that can be called in your CadQuery scripts.

Pre-requisites

CadQuery Shape primitives


3d shapes

Box

Workplane.box

result = cq.Workplane("XY" ).box(3, 3, 3)

07

# Copyright 2022 James Adams
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,

Dollhouse

Dollhouse Front

Dollhouse Back

Description

First large project I've attempted using CadQuery.
Goal was to make a modular dollhouse for my kids.

import cadquery as cq
from cqterrain import Building, stone, window
def add_stones(wall, length, height, wall_width, rotate=0, seed="test4"):
# static boxes to act as stone
tile = cq.Workplane("XY").box(10,10,2)
tile2 = cq.Workplane("XY").box(8,8,2)
tile3 = cq.Workplane("XY").box(6,12,2)
tile4 = cq.Workplane("XY").cylinder(6,4)
import cadquery as cq
import math
from cqterrain import Building, stone, window
from cadqueryhelper import series, grid
def grill_custom(length=20, width=4, height=40, columns=4, rows=2, grill_width=1, grill_height=1):
# Make a flat plane
pane = cq.Workplane("XY").box(length, grill_height, height)
t_width = length / columns
t_height = height / rows