{"action":"created","issue":{"url":"https://api.github.com/repos/dcowden/cadquery/issues/155","repository_url":"https://api.github.com/repos/dcowden/cadquery","labels_url":"https://api.github.com/repos/dcowden/cadquery/issues/155/labels{/name}","comments_url":"https://api.github.com/repos/dcowden/cadquery/issues/155/comments","events_url":"https://api.github.com/repos/dcowden/cadquery/issues/155/events","html_url":"https://github.com/dcowden/cadquery/issues/155","id":190242239,"number":155,"title":"The idea of adding a sketchlet function into the 2D operations","user":{"login":"huskier","id":5828575,"avatar_url":"https://avatars.githubusercontent.com/u/5828575?v=3","gravatar_id":"","url":"https://api.github.com/users/huskier","html_url":"https://github.com/huskier","followers_url":"https://api.github.com/users/huskier/followers","following_url":"https://api.github.com/users/huskier/following{/other_user}","gists_url":"https://api.github.com/users/huskier/gists{/gist_id}","starred_url":"https://api.github.com/users/huskier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huskier/subscriptions","organizations_url":"https://api.github.com/users/huskier/orgs","repos_url":"https://api.github.com/users/huskier/repos","events_url":"https://api.github.com/users/huskier/events{/privacy}","received_events_url":"https://api.github.com/users/huskier/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-11-18T05:59:13Z","updated_at":"2016-11-29T05:40:08Z","closed_at":null,"body":"The idea is that we could store some useful sketches in data files( maybe a special formatted file), and we could re-use them. The sketchlet function could parse the special formatted files or just strings, and draw them.\r\n\r\nWith sketchlet function, we could significantly simplify the example \"Panel With Various Connector Holes\", and make the code elegant.\r\n\r\nThe following code is just a simple demo, no any parsing function. **The current problem is that we could only add one complete wire into the sketchlet wire, otherwise Wire.assembleEdges complaint that \"command not done\".** In the following code, I commented the second circle code.\r\n\r\n`\r\n\r\n    def sketchlet(self):\r\n        def makeSketchletWire(pnt):\r\n            p0 = pnt\r\n            p1 = p0.add(Vector(-23.5,0,0))\r\n            e1 = Edge.makeCircle(1.6,p1)\r\n            #p2 = p0.add(Vector(23.5,0,0))\r\n            #e2 = Edge.makeCircle(1.6,p2)\r\n            listOfEdges = []\r\n            listOfEdges.append(e1)\r\n            #listOfEdges.append(e2)\r\n            sketchWire = Wire.assembleEdges(listOfEdges)\r\n            sketchWire.forConstruction = False\r\n            return sketchWire       \r\n        return self.eachpoint(makeSketchletWire, useLocalCoordinates=True)\r\n`\r\nTo call sketchlet:\r\n`\r\n\r\nresult = cadquery.Workplane(\"XY\").pushPoints( [ (25, 25),(50, 50)] ).sketchlet().extrude(50)\r\nshow(result)\r\n\r\n`\r\n"},"comment":{"url":"https://api.github.com/repos/dcowden/cadquery/issues/comments/263481525","html_url":"https://github.com/dcowden/cadquery/issues/155#issuecomment-263481525","issue_url":"https://api.github.com/repos/dcowden/cadquery/issues/155","id":263481525,"user":{"login":"huskier","id":5828575,"avatar_url":"https://avatars.githubusercontent.com/u/5828575?v=3","gravatar_id":"","url":"https://api.github.com/users/huskier","html_url":"https://github.com/huskier","followers_url":"https://api.github.com/users/huskier/followers","following_url":"https://api.github.com/users/huskier/following{/other_user}","gists_url":"https://api.github.com/users/huskier/gists{/gist_id}","starred_url":"https://api.github.com/users/huskier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huskier/subscriptions","organizations_url":"https://api.github.com/users/huskier/orgs","repos_url":"https://api.github.com/users/huskier/repos","events_url":"https://api.github.com/users/huskier/events{/privacy}","received_events_url":"https://api.github.com/users/huskier/received_events","type":"User","site_admin":false},"created_at":"2016-11-29T05:40:08Z","updated_at":"2016-11-29T05:40:08Z","body":"@dcowden With the help of dxfgrabber, it is not so difficult to import DXF file. However, DXF drawings are usually more complex than CQ's native drawing. I am afraid we have to deal with the limits on the number of wires.\r\n\r\nAnother issue is that the dependencies. For the scripting from CLI, maybe it is not a big problem, and we just install the dependencies. However, for the FreeCAD's plugin, we have to think a way to make it work before the conda packages and the docker containers.\r\n\r\nAnyway, we could just implement the function first.\r\n\r\nMeanwhile, I will think about a solution to the limits on the number of wires."}}
{"actor":{"display_login":"huskier"}}