not to mention the portability problems with floating point. the algorithm for coplanarity under the floating point coordinates is quite a bit larger and of course has a 'fuzz factor' built in because in reality most planes in floating-point coordinate space do not intersect very many coordinate-points. The algorithm for coplanarity in Rational coordinates is a few lines of code. (* - "Coplanar" here means "you use some algorithm to determine planarity" because we are working with computers here and actual bits, not theoretical objects. You are losing information any time you convert the underlying coordinates when they are of differing resolutions, just like transferring a 2d-photo from one resolution device to another (screen to printer, scanner to overhead-projecter, DVD to Bluray, 1080p to 1024x768, etc etc), with the added complication that floating point coordinates have different resolutions depending on distance from the origin 0,0,0. 4 points on a single face can be coplanar in Rational coordinates, but if you convert to floating point, then back to Rationals, they will not necessarily still be be coplanar*. Another thing that can be altered is planarity. (in other words its similarity to a sphere, a torus, a two hole torus, etc, the way a coffee cup with a handle is topologically the same as a donut). well that's a tricky business.Ĭonverting Nef Polyhedron back and forth from Rational coordinates to Floating Point coordinates has the possibility of altering the shape, for example the Euler Characteristic (the Topology) is not necessarily going to be preserved when you convert to floats and back to rationals. Now, converting a non-2-Manifold Polyset into a meaningful Nef Polyhedron. "Does it mean Nef polyhedron can't convert non-manifolds? (in the above example the translated sphere touches plate at one point)"Īctually we can convert from Nef directly to Polyset, regardless of 2-Manifoldness, the code is just not enabled currently. Also the developers of OSscad can focus on making the engine faster and more stable instead of trying to maintain and debug another feature. ![]() if OpenSCAD can be enhanced such that ordinary users can implement things like Bend, then it will open a whole cool new set of possibilities for people out there to do cool stuff with OpenSCAD without having to hack the C++ (and get a compiler installed on their machine, and the libraries, etc etc). you should also validate that the resulting mesh has no self-intersections, and remove collapsed polygons (should you support that) Transform each such internal point accordingly.Įdit. Remesh the resulting polygons by adding internal points according to the new edge vertices. ![]() If that distance is higher than a threshold, split the edge by adding a new vertex at that position, and repeat recursively for all edges until all satisfy the distance threshold. What I would do is to iterate over all edges of the mesh, and find the point along the edge where the linear transformed position is furthest away from the ideal curved edge (the straight line segment mapped over the function). A CGAL::Polyhedron_3 could do the job, but could also be overkill. For this you probably need a more structured data format than PolySet. Next step is to handle cases where the mesh isn't sufficiently detailed by adding extra vertices to the shape to make the bends a bit nicer (e,g, consider bending a cube()). This will work, and give a result that should look ok given that the starting mesh is sufficiently detailed. Then just transform each vertex in the PolySet with your bend function. To start with, I just suggest you make sure the input geometry is a PolySet (collect the children, see other examples in GeometryEvaluator). in GeometryEvaluator., implement a Response GeometryEvaluator::visit(State &state, const ReshapeNode &node) (once again, see the other methods there for examples). ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |