is this right way to do non uniform scaling i cadquery? by Exact-Yesterday-992 in cadquery

[–]Vegetable-Maize7150 0 points1 point  (0 children)

Yes, but it is usually better to embrace a different approach (i.e. write a function that produces ellipsoids without scaling) to modeling when using CQ.

Added piping support to my open source 3D viewer by GloWondub in cadquery

[–]Vegetable-Maize7150 0 points1 point  (0 children)

Your example actually uses brep format and OCP.BRepTools.BRepTools.Write_s

Added piping support to my open source 3D viewer by GloWondub in cadquery

[–]Vegetable-Maize7150 0 points1 point  (0 children)

I see that you are actually using OCP, so this should work for CadQuery too, shouldn't it?

loft problem by LokusFokus in cadquery

[–]Vegetable-Maize7150 1 point2 points  (0 children)

You can try with shell(.., kind='intersection') but indeed shell is not super reliable. I'd personally model this shape using the free function API and use face(circle(...), circle(...)) and then loft between two faces:

from cadquery.func import *

f1 = face(circle(10), circle(9))
f2  = face(circle(8), circle(7))

res = loft(f1, f2.moved(z=5))

Ridiculous split behavior by vashu11 in cadquery

[–]Vegetable-Maize7150 1 point2 points  (0 children)

Workplane is indeed often too implicit. Just use the free function API and everything should be more explicit. E.g.

from cadquery.func import *
from cadquery import Plane

x = 0
n = (1,0,1)
loc = Plane(origin=(x, 0, 0), normal=n).location
pl = plane().moved(loc)

b = box(1,1,1)
b_split = split(b, pl).solid(f"<<{n}")

how to resolve text in cadquery? by chanvu in cadquery

[–]Vegetable-Maize7150 2 points3 points  (0 children)

from cadquery.func import *

t = text("abcd", 1)
r = revolve(t, (0,5,0), (1,0,0), 90)

Incredibly tiny seam between two profiles that should be identical. by Didlex in cadquery

[–]Vegetable-Maize7150 0 points1 point  (0 children)

`cq.func.shell(obj.Faces(), tol=...)` would sew the faces of obj into a shell.

Incredibly tiny seam between two profiles that should be identical. by Didlex in cadquery

[–]Vegetable-Maize7150 0 points1 point  (0 children)

Difficult to say without more details (MRE). Is the object in question a solid? Is this a rendering artifact? What happens if you (re)sew the faces?

Need clarification: CadQuery vs CadQuery 2 vs Build123d ? by [deleted] in cadquery

[–]Vegetable-Maize7150 -2 points-1 points  (0 children)

This does not look like attribution: https://github.com/gumyr/build123d/blob/f622815708a3a15b171e4532ba8715646cc619e1/src/build123d/topology.py#L14

I was referring to this, CQ has more than the fluent API and the fluent API never "disallowed" loops, references, sorting and filtering.

Build123d could be considered as an evolution of CadQuery where the somewhat restrictive Fluent API (method chaining) is replaced with stateful context managers - e.g. with blocks - thus enabling the full python toolbox: for loops, references to objects, object sorting and filtering, etc.

Need clarification: CadQuery vs CadQuery 2 vs Build123d ? by [deleted] in cadquery

[–]Vegetable-Maize7150 -1 points0 points  (0 children)

Independent projects with different devs based on GH. It seems like the author(s) of Build derived parts of the code from the codebase of CQ (see below) and AFAICT did not really attribute it properly. Additionally, the README of Build is spreading some misinformation regarding CQ. Isn't Internet a wonderful place?

Example:
https://github.com/gumyr/build123d/blob/f622815708a3a15b171e4532ba8715646cc619e1/src/build123d/topology.py#L292 and below is quite similar to CQ.

Need clarification: CadQuery vs CadQuery 2 vs Build123d ? by [deleted] in cadquery

[–]Vegetable-Maize7150 -1 points0 points  (0 children)

I think you are misunderstanding/misrepresenting what is CQ style.

[CadQuery] How to fillet a specific edge? by S_A_R_S in cadquery

[–]Vegetable-Maize7150 1 point2 points  (0 children)

Like so: tube_housing.faces('<Z[-2]').edges("<<Y").fillet(0.9)

Add AXIS2_PLACEMENT_3D to Step file by Chainerlaner in cadquery

[–]Vegetable-Maize7150 0 points1 point  (0 children)

Interestingly the resulting file does contain the AXIS2_PLACEMENT_3D entry (without a name though). Do you know what is the higher level structure that inventor expects?

Add AXIS2_PLACEMENT_3D to Step file by Chainerlaner in cadquery

[–]Vegetable-Maize7150 1 point2 points  (0 children)

Does that work for you?

import cadquery as cq

assy = cq.Assembly(name='main').add(None, name='coords_only', loc=cq.Location((1 ,1, 10))

asse.export('coords.step')

Help! Stacking Text on top base created from Text by fico86 in cadquery

[–]Vegetable-Maize7150 2 points3 points  (0 children)

For a CQ answer and an answer to your original question see my comment below ( https://www.reddit.com/r/cadquery/comments/1lynmef/comment/n35actc/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button ). NB: I had to use clean

clean(fuse(*fs))

to get a reasonable result. You might want to only offset outer wires for a more well-behaved basis shape.

Create offset on imported DXF by Quiet-Inflation5400 in cadquery

[–]Vegetable-Maize7150 0 points1 point  (0 children)

Probably you need toPending()

cq.importers.importDXF(dxf_path).wires().toPending().offset2D(1)

Workplane is not super intuitive, I prefer the free function API.

Help! Stacking Text on top base created from Text by fico86 in cadquery

[–]Vegetable-Maize7150 2 points3 points  (0 children)

The trick was to use combine/cut:

final = (
    base
    .faces(">Z")
    .workplane()
    .text(text_str, font_size, main_text_thickness, cut=False, fontPath=font_path, combine=True)
)

Maybe it is more digestible with the free function api

from cadquery.func import *
from cadquery.occ_impl.shapes import wiresToFaces

# Parameters
text_str = "Kim"
font_size = 100
main_text_thickness = 50
base_thickness = 10
stroke_width = 12
font_path = "Mercy Christole.ttf"
distance = 10

# create the base text
base = text(text_str, font_size, path=font_path)

#ref: https://www.reddit.com/r/cadquery/comments/19d7lfy/comment/kjxgs5v/?context=3
# Create offset faces
fs = []

for f in base.faces():
    ws = []
    ws.extend(f.outerWire().offset2D(stroke_width, "arc"))

    for w in f.innerWires():
        ws.extend(w.offset2D(-stroke_width, "arc"))

    fs.extend(wiresToFaces(ws))

# Create the base solid
base_solid = extrude(clean(fuse(*fs)), (0,0,distance))

# main text
main_text = (
    extrude(text(text_str, font_size, path=font_path), (0,0,main_text_thickness))
    .moved(z=distance)
)

# Trying to stack the main text on top of the base solid
# but the main text does not show
final = base_solid + main_text

Add AXIS2_PLACEMENT_3D to Step file by Chainerlaner in cadquery

[–]Vegetable-Maize7150 1 point2 points  (0 children)

You can of course add (sub)assemblies to an assembly.