--
cadquery home: https://github.com/dcowden/cadquery
post issues at https://github.com/dcowden/cadquery/issues
run it at home at : https://github.com/jmwright/cadquery-freecad-module
see it in action at http://www.parametricparts.com
---
You received this message because you are subscribed to the Google Groups "CadQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/3090ee44-9e2b-40c7-befc-aed7c59a12aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
@Dave can we get this added to the featured projects in the documentation?
Adam, thanks for doing this! I'm very interested in hearing more about your process, and I've shared this thread with a couple people over at Mach 30. It coincides with some work we had been doing with CadQuery, Jupyter and IPython at one point. I think the example you've created is very useful.
@Dave can we get this added to the featured projects in the documentation?
--
cadquery home: https://github.com/dcowden/cadquery
post issues at https://github.com/dcowden/cadquery/issues
run it at home at : https://github.com/jmwright/cadquery-freecad-module
see it in action at http://www.parametricparts.com
---
You received this message because you are subscribed to the Google Groups "CadQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/3df1d2e3-5604-46bb-8897-f032c7389017%40googlegroups.com.
@Dave I expect there would be plenty of challenges to using Jupyter for the default CadQuery 2.0 GUI, but if it worked it could be a powerful tool for everybody from Makers to professional scientists.
--
cadquery home: https://github.com/dcowden/cadquery
post issues at https://github.com/dcowden/cadquery/issues
run it at home at : https://github.com/jmwright/cadquery-freecad-module
see it in action at http://www.parametricparts.com
---
You received this message because you are subscribed to the Google Groups "CadQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/d3b9190b-9ee3-485f-823c-52c110fd2567%40googlegroups.com.
wow! I had not heard of jupyter, but that's really cool!This is very well timed. Our other Adam, Ubranczyk, has recently made a huge stride toward the next generation version of CadQuery, which is directly based on OCC, rather than FreeCAD. (https://github.com/adam-urbanczyk/cadquery) His work is really awesome-- its about 20 test cases short of passing all the existing tests.At that time, we'll have a challenge on our hands-- we will lose the ability to use Jeremy's cadquery freecad GUI ( https://github.com/jmwright/cadquery-freecad-module) . Cadquery has exploded since a GUI became available. Its simply indispensable when doing CAD, as it turns out.Your project represents one way we could get a GUI with the new CQ version. Jeremy had done some prototyping with electron in the past as an alternative. What are your thoughts on the relative pros and cons of using Jupyter vs using a custom-built app?
On Sun, Jun 11, 2017 at 7:53 AM, Adam Vermeer <adam.v...@gmail.com> wrote:
Hello all,
I threw together a working example of a jupyter notebook with CadQuery.
I've seen a few topics here and there mentioning it, but hadn't seen a working example.You can see what I've done here (it's a github repo containing the .ipynb file, a static html file, and a gif showing that it does in fact work)It really isn't anything special, but it works! I'm not certain how useful anyone else may find this, but if there's enough interest I could go into more detail about the setup process I took.
Additionally, if anyone can see a better way to accomplish the same goal, please let me know and/or feel free to improve on things yourself.
--
cadquery home: https://github.com/dcowden/cadquery
post issues at https://github.com/dcowden/cadquery/issues
run it at home at : https://github.com/jmwright/cadquery-freecad-module
see it in action at http://www.parametricparts.com
---
You received this message because you are subscribed to the Google Groups "CadQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+u...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+u...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/31bf2d22-7370-4660-9aa1-28b13d3fecc6%40googlegroups.com.
Electron worked pretty well, but the platform seems to always suffer from high CPU utilization issues. My UI was no exception. Adam Urbanzyk and I have experimented with other PythonOCC GUIs, and something wxPython or Qt based is probably the best bet for flexibility, stability and efficiency. The problem is that those UIs will be more work (at least in my opinion) to create, maintain and distribute in a cross-platform way. Also, as you've noted, having a web GUI is a big plus. This was the main reason I focused on Electron for awhile. If modularized correctly, you end up with a desktop GUI that can also be run as a web app. That's a pretty compelling option for a resource-constrained open source community.
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/b89251a8-f65d-4ba5-ab0e-f3c2b742b814%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/32dbd2a5-b5c7-48f4-af29-18c6d15ee368%40googlegroups.com.
If you want to (and can) talk about it, what's your purpose for doing this work? What do you plan to use it for? I'm just curious.
--
cadquery home: https://github.com/dcowden/cadquery
post issues at https://github.com/dcowden/cadquery/issues
run it at home at : https://github.com/jmwright/cadquery-freecad-module
see it in action at http://www.parametricparts.com
---
You received this message because you are subscribed to the Google Groups "CadQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/79990de8-5181-41e2-957a-21c1d20517cb%40googlegroups.com.
I do think that your projects will be useful for others, and am glad you're open sourcing your efforts.
BTW - Here's a topic where members of the community have shared some of the things they've done with CadQuery if you're interested. https://groups.google.com/forum/m/#!topic/cadquery/mS2ITd37sQA
Widget Javascript not detected. It may not be installed or enabled properly.
I installed pythreejs and enabled it for Jupyter. Am I missing another module?
@Adam, man that latest example of the complete assembly is so awesome!A couple of insights and questions for you:(1) I think this code is _way_ easier than it would be in OpenSCAD, do you agree?(2) your code does a good job of being cq-idiomatic. very easy to follow(3) I would like to do a better job in dealing with 2-d. cq seems to work well when you have simple 2d and you are moving to 3d. But it seems to become cumbersome complared to using a GUI when you need to draw a complex 2d sketch. Its a huge loss in functionality relative to a CAD system ( even FreeCAD) when you lose the ability to have a 2d geometric solver available. When i use CAD, i tend to use a lot of construction geometry and trims/extends to create constrainted geometry, and it feels like i just give that up in CQ. What are your thoughts on that? One solution ( that SCAD uses ) is to allow DXF import. That lessens the pain, but its a very non-parametric solution.(4) I know there is a lot that can be done with mate-less assemblies, but could you take an idea at how in CQ we might represent mate connectors?
--
cadquery home: https://github.com/dcowden/cadquery
post issues at https://github.com/dcowden/cadquery/issues
run it at home at : https://github.com/jmwright/cadquery-freecad-module
see it in action at http://www.parametricparts.com
---
You received this message because you are subscribed to the Google Groups "CadQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/e01261ee-1118-4dc0-be04-db426d4b58a1%40googlegroups.com.
--
cadquery home: https://github.com/dcowden/cadquery
post issues at https://github.com/dcowden/cadquery/issues
run it at home at : https://github.com/jmwright/cadquery-freecad-module
see it in action at http://www.parametricparts.com
---
You received this message because you are subscribed to the Google Groups "CadQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/26cdef6b-8d7f-4f19-b32b-7a850f8ea200%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/80816f4d-d84a-45fa-8bb8-682deb98962b%40googlegroups.com.
--
cadquery home: https://github.com/dcowden/cadquery
post issues at https://github.com/dcowden/cadquery/issues
run it at home at : https://github.com/jmwright/cadquery-freecad-module
see it in action at http://www.parametricparts.com
---
You received this message because you are subscribed to the Google Groups "CadQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/968a6c6e-0a74-4026-841e-7084f2adf58c%40googlegroups.com.
Awesome, let us know if we can help...
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/0d734d32-37e3-451e-ba1f-0eda609292b2%40googlegroups.com.
--
cadquery home: https://github.com/dcowden/cadquery
post issues at https://github.com/dcowden/cadquery/issues
run it at home at : https://github.com/jmwright/cadquery-freecad-module
see it in action at http://www.parametricparts.com
---
You received this message because you are subscribed to the Google Groups "CadQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/33d455fb-a4d4-424e-9c8e-166b0688fd2a%40googlegroups.com.
Whoa that's awesome! GUI inputs for parameters, super nice!This is an example of what I have always hopes for cq script!
ut.
pip install git+https://github.com/dcowden/cadquery
import cadquery as cq
import sys
sys.path.insert(0, '/home/jwright/Downloads/avnb/_modules')
import cqjupyter
from cqjuypter import *
--
cadquery home: https://github.com/dcowden/cadquery
post issues at https://github.com/dcowden/cadquery/issues
run it at home at : https://github.com/jmwright/cadquery-freecad-module
see it in action at http://www.parametricparts.com
---
You received this message because you are subscribed to the Google Groups "CadQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/48a5a5bd-720c-47fd-9d0a-148261566c98%40googlegroups.com.
Awesome! Dave would probably have more thoughts on hosting. I'm a Docker newbie, but I'm working on getting up to speed.
I'm hoping to have all the CadQuery examples working with CQNB within a week or two.
# These can be modified rather than hardcoding values for each dimension.width = 3.0 # The width of the plateheight = 4.0 # The height of the platethickness = 0.25 # The thickness of the platepolygon_sides = 6 # The number of sides that the polygonal holes should havepolygon_dia = 1.0 # The diameter of the circle enclosing the polygon points
result = cq.Workplane("front").box(width, height, thickness) \ .pushPoints([(0, 0.75), (0, -0.75)]) \ .polygon(polygon_sides, polygon_dia) \ .cutThruAll()
# Displays the result of this scriptshow_object(result)
TypeError Traceback (most recent call last)
/usr/local/lib/python2.7/dist-packages/ipywidgets/widgets/interaction.pyc in update(self, *args)
215 value = widget.get_interact_value()
216 self.kwargs[widget._kwarg] = value
--> 217 self.result = self.f(**self.kwargs)
218 if self.auto_display and self.result is not None:
219 display(self.result)
/home/jwright/Downloads/cqnb/cqjupyter.py in mkui(**kwargs)
224 final_scale = scale
225
--> 226 mkui.base, mkui.new_model = update_build(cq_model, new_vals, color=color, scale=final_scale)
227
228 # Create the Export options + Button
TypeError: 'NoneType' object is not iterable
--
cadquery home: https://github.com/dcowden/cadquery
post issues at https://github.com/dcowden/cadquery/issues
run it at home at : https://github.com/jmwright/cadquery-freecad-module
see it in action at http://www.parametricparts.com
---
You received this message because you are subscribed to the Google Groups "CadQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/1f1ad675-4e1c-44e2-8967-55035f9afe6f%40googlegroups.com.
result = cq.Workplane("front").box(width, height, thickness) \ .pushPoints([(0, 0.75), (0, -0.75)]) \
.polygon(int(polygon_sides), polygon_dia) \ .cutThruAll()
def set_value(self, new_value):
if len(self.valid_values) > 0 and new_value not in self.valid_values:
raise InvalidParameterError(
"Cannot set value '{0:s}' for parameter '{1:s}': not a valid value. Valid values are {2:s} "
.format(str(new_value), self.name, str(self.valid_values)))
if self.varType == NumberParameterType:
try:
f = float(new_value)
self.ast_node.n = f
except ValueError:
raise InvalidParameterError(
"Cannot set value '{0:s}' for parameter '{1:s}': parameter must be numeric."
.format(str(new_value), self.name))
elif self.varType == StringParameterType:
self.ast_node.s = str(new_value)
elif self.varType == BooleanParameterType:
if new_value:
self.ast_node.id = 'True'
else:
self.ast_node.id = 'False'
else:
raise ValueError("Unknown Type of var: ", str(self.varType))
import pythreejs as p3js
cone = shapes.Solid.makeCone(5,1,5)
t = Tesselator(cone.wrapped)
t.Compute(compute_edges=True)
from six import StringIO
import json
import pythreejs
import numpy as np
from pythreejs import *
color='yellow'
vertices = [t.GetVertex(i) for i in range(t.ObjGetVertexCount())]
faces = [t.GetTriangleIndex(i) for i in range(t.ObjGetTriangleCount())]
normals = [t.GetNormal(i) for i in range(t.ObjGetNormalCount())]
geom = pythreejs.PlainGeometry(vertices=vertices, faces=faces)
mtl = pythreejs.LambertMaterial(color=color,shading='FlatShading')
obj = pythreejs.Mesh(geometry=geom, material=mtl)
tet = p3js.PlainGeometry(vertices=vertices, faces=faces)
box = p3js.BoxGeometry(height=1, width=1, depth=1)
mat_red = p3js.LambertMaterial(color='red')
m_tet = p3js.Mesh(geometry=tet, material=mat_red, position=[-0.5, -0.5, 0.5])
m_box = p3js.Mesh(geometry=box, material=mat_red, position=[0, 0, 0])
dl = p3js.DirectionalLight(color='white', position=[0, 1, 5], intensity=1)
al = p3js.AmbientLight(color='#777777')
s = p3js.Scene(children=[obj,al])
cam = p3js.PerspectiveCamera(position=[2, 3, 2], up=[0, 0, 1], children=[dl])
renderer = p3js.Renderer(camera=cam, scene=s, controls=[p3js.OrbitControls(controlling=cam)])
renderer
# old line
geom = pythreejs.PlainGeometry(vertices=vertices, faces=faces)
# new line. Only change is using faceNormals.
geom = pythreejs.PlainGeometry(vertices=vertices, faces=faces, faceNormals=normals)