New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples don't run as intended #111
Comments
I'm getting the same results running 0.17 from the FreeCAD daily ppa in Ubuntu 17.10.
I wonder if this is related to the wire sorting problem in CadQuery issues 173 and 83. @RustyVermeer do you have any insight on the two examples above (4 and 6) based on your current work on wire/edge sorting for DXF import? @linuxcf On example 8, the reason the hexagons will only cut from the center of the box is that the box call centers the box in the origin workplane. Then when the hexagons are drawn, they're drawn on the origin workplane too. You can see where the origin workplane is by clicking View->Toggle axis cross. That will put the origin marker in the view so that you can see where your part is in relation to the origin and origin workplane. In order to get the behavior you want there are several options, but here are a couple. # Selects the face in the minimum Z direction, establishes a workplane, and puts the hexagons on that.
result = cq.Workplane("front").box(width, height, thickness) \
.faces('<Z').workplane() \
.pushPoints([(0, 0.75), (0, -0.75)]) \
.polygon(polygon_sides, polygon_dia) \
.cutThruAll() # Extrude a rectangle instead of using a box so that the resulting solid sits flat on the origin workplane instead of the workplane being in the middle of the box.
result = cq.Workplane("front").rect(width, height).extrude(thickness) \
.faces('<Z').workplane() \
.pushPoints([(0, 0.75), (0, -0.75)]) \
.polygon(polygon_sides, polygon_dia) \
.cutThruAll() There are several other ways to do it too including a centered argument for the box function that will control whether the box sits on "top" of the origin workplane, or is embedded down in it.
The latest version of this workbench switched over to the CadQuery Gateway Interface (CQGI). It's a way for us to make scripts execute in a standard way across CadQuery environments. You can still use |
Ok, so updating to FreeCAD 0.17 actually broke my DXF stuff, sadly. The code of interest in CadQuery is here in the linearExtrude function I wrote some code to mimic that function and find out what's going on. The code below can be pasted into the FreeCAD 0.17 CadQuery editor and should work.
you should see the incorrect behavior, like before. If this works on other machines, and not just my own, I think we're on the right track for a solution.
EDIT: added Shape and Compound to imports in code sample above |
I Definitely don't have a problem with that, I'm sure validate can't hurt |
@RustyVermeer Thanks a lot for digging into this. Your solution looks good to me too. BTW - I had to add the following line to get the example to run on my system. from cadquery import Shape, Compound |
sorry, yea. I did too, actually. I 'cleaned up' the code before pasting here. Must've gone too far :) |
Where is the appropriate place to make this change, in @dcowden 's CadQuery repo or here? |
@RustyVermeer The main CadQuery repo is the correct place to make this change. It's a long story, but I'm currently not able to have the CadQuery lib set up so that I can push changes back to that repo from here. |
Made and merged that change. I hope that was all done correctly |
If it causes problems we could try to add an isValid() check before calling validate(), but I don't see any problems so far. This change has been integrated into the workbench. Thanks @RustyVermeer ! |
@linuxcf Please do an update through the add-on manager. Feel free to reopen this issue if you have any other problems. |
@jmwright Thank you. I can confirm that after the update, CADquery's examples 4 and 6 now work as intended on my FC17. |
Thanks for making this change guys! It's been a nagging issue for a while, it's great to finally have it fixed. |
I installed CADQuery on my FreeCAD17, running on stock 64-bit Ubuntu 16.04.3LTS with the latest 4.10 Ubuntu kernel, with the FreeCAD add-on manager. When I ran examples 4 and 6, the resulting solids were the complements of the intended ones. I have attached pertinent files.
Also, in Example 8, the regular hexagons are only cut through half the thickness of the slab, no matter what I do. I even used 'CutThruAll()' and 'CutBlind()' with explicit arguments, but the end result was still the same.
All the examples I checked had 'from Helpers import show' missing.
Ex004.pdf
Ex006.pdf
The text was updated successfully, but these errors were encountered: