2/18/2024 0 Comments Openscad extrude along path![]() ![]() With them, it would be possible to create much more generic, simple and reusable The polyhedron approach is fine if you have preexisting shapes, but if you want to construct the 2D shapes parametrically, by using the 2D subsystem and boolean operations, then you can't use the polyhedron approach since you have no way to access the point info from the 2D shape. The single most helpful change to the core language would be support for function variables though. I hacked together something that basically works for this, but it could use some more work. The only thing we would need native code for is to handle self-intersecting geometry, for example to allow rotate_extrude() circle() to generate a sphere. With that, you have all the vertices of your mesh and all you need to do is to triangulate the sides and possibly the end caps and feed everything to a single polyhedron() call. The path for the extrusion is quite easy to define as a parametric affine or projective 3d transformation (allowing an arbitrary composition of rotation, scaling, translation, shearing, etc). From that, you can easily define any morphing/blending function. Point associativity between two shapes of equal length would just be based on position in the array. The (experimental) concat() function is highly recommended though.īasically, you define a 2D shape as an array of points (2d or 3d). On the other hand, what you want to accomplish is already kind of easy to do in client code as long as your resulting extrusion has no self-intersections. Even if they have the same number, n, of vertices (which in itself is hard to guarantee in the general case), just finding which of the n different solutions to associate vertices with is not obvious. Then, once you have a way to algorithmically/parametrically express general paths in space, you could load a 2d representation of your desired perpenicular section and extrude it along that given I agree that morphing/connecting different shapes like that could be useful, but given how shapes (2d polygons) are represented in OpenSCAD, I have no idea how to automatically handle linking of the two shapes. t would be a value ranging from 0 to 1 determining the point along the path where the folding operation would happen and v would be a vector indicating the direction of the folding axis and the intensity of the folding in terms of degrees, just like the parameter used in the rotate() operator. fold(t, v) - to fold the path at a certain point the same way you would phisically fold a metal wire at a given point. union() - to join two path representations arc(r, start, end) which draws an arc with radius=r starting at angle=start and ending at angle=end line(p1, p2) where p1 and p2 are points in space (x,y,z) The construction primitives we have in openscad deal with 2d shapes in a plane (the 2D subsystem) and 3D primitives (cubes, cylinders, etc.) What we would need is a set of: In the next tutorial I'm going to make some more complex objects and send them to the printer for some real world results.One thing we should consider is an API for modeling arbitrary paths in 3dimensional-space. I don't think that using the customizer to automate common tasks takes away from the "programming" based spirit of Openscad at all because as you come up with more ideas on how you can adapt it to do what you want the deeper you get into the programming aspect. Now I can import my DXF file and rotate extrude it: Click for larger versionĪs you can see from this example the capabilties you can add to your Openscad template are only limited by your imagination and ability to take a few weeks to learn the program. ![]() Now I add my new module to the rest so I can call it independently or as part of the group: click for a larger version You will notice that I now get the values for rotate degrees and fragments from the value of the slider bar, and I set ShowExtrudeLayer so that if it's not checked (false) the program just goes to the next command. Next I add a new module for Rotate Extrude: click for a larger version I'm going to add a new section in the Customizer to Rotate Extrude a specified layer: Click for larger versionĪfter specifying ShowExtrudeLayer(checkbox),layer name input(text input), a slider for rotate degrees, one for number of fragments and then clicking update, the new menu shows up in the customizer: click for larger version Set the nodes to lines and export to dxf: Click for larger version First I'm going to draw a basic shape for my object: Click for larger version ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |