openscad/doc/TODO.txt

272 lines
12 KiB
Plaintext

BUGS (FIXME: Verify and move these to github)
---------------------------------------------
o Some invalid DXF data gets pass the import checks and breaks the tessing code
o Tesselation via GLU sometimes produces strange results
o Export STL: Exports existing CGAL model even though the current model is changed, but not CGAL rendered
o Look into the polygon winding and rotate_extrude() problem reported by Britton
o CGAL Aff_transformation_3 doesn't support non-affine transformations (non-aff-matrix.scad)
o 2D union of polygons with a touching vertex doesn't work. see testdata/scad/bugs/polygon-touch.scad
STL Import BUGS (FIXME: Verify and move these to github)
--------------------------------------------------------
Using STL-imported models is tricky and triggers multiple issues:
(these all fail with the usual "Illegal polygonal object" error)
1) null-faces causes F6 rendering to fail while F5 rendering succeeds.
(null-faces are exported by OpenSCAD). Example: adns2610_dev_circuit_inv.stl
by Andrew Plumb
2) Even very simple imported STL models don't render correctly with F5 when taking
a difference(), though F6 looks correct. Example: test_cube.stl by Andrew Plumb
with this scad file:
difference() {
import_stl("test_cube.stl");
translate([2,2,2]) cylinder(h=10);
}
3) More complex STL models with something simple unioned or subtracted fails rendering
using F6 even though F5 works. Example: adns2610_dev_circuit_inv.stl
by Andrew Plumb with the three null-faces removed by MeshLab with this scad file:
union() {
import_stl("adns2610_dev_circuit_inv_4.stl");
sphere(r=5);
}
4) More complex STL models cannot be projected (both F5 and F6).
Example: adns2610_dev_circuit_inv.stl by Andrew Plumb with the three
null-faces removed by MeshLab and this scad file:
projection(cut=true) {
import_stl("adns2610_dev_circuit_inv.stl");
}
USER INTERFACE
--------------
o Preferences
- Beautify color schemes
- Color schemes read from file
- Color scheme editor
- wireframe width
- pointsize
- OpenGL params
- Default language feature settings
- Make the library search path configurable?
- Turn on/off caching (advanced)
o MDI
- Think about how to do MDI the right way
- Ctrl-W should close the current dialog, not the current main window
-> implement as for Preferences?
- Menu bar handling:
Mac: share menubar among all top-level windows?
- currentPath is global but is used by each document, e.g. parser
and handle_dep.
o 3D View
- Improve mouse rotation/zoom/pan
- Add modifier key combos to handle pan and zoom on 1 mouse button systems
- Show grid
- Measurement ticks on the axes that look like rulers that one can turn off and on.
- 4 x split view w/orthogonal cameras?
- Quick highlighting of object under the cursor in the editor
- View All
- Allow specifying viewpoint in the scad file
- overlay indicator displaying current view mode
- Use OpenGL picking to facilitate ray-tracing like features like measuring
thicknesses, distances, slot thicknesses etc.
- Add option to change lights, e.g. add an optional camera light
- 2D objects are rendered at z = -0.1 - why?
- Rewrite to use VBOs or smth. - avoid inline calculations
- Rewrite to a higher-level library (e.g. OSG)?
- Make navigation (e.g. zoom) available through menu entries (requested by disabled user)
o Editor wishlist
- More infrastructure for external editor (allow communication from the outside)
- Preferences GUI for the features below
- line numbers
- tear-off/maximize options?
- Save somehow uses current dir, even if the file is already saved earlier
- Code completion/hints for builtin (and user-defined) functions/modules
- builtin quick function reference/help
- Drawer/popup with all modules/functions listed which can be inserted into
the editor by clicking or drag&drop -> icons in toolbar?
-> This would be moving in the direction of a traditional CAD GUI
and needs a fair bit of thinking.
- Display some kind of line wrap indicator
- Couple the source code to the AST to allow highlighting selected elements
in the source code in the 3D view
- Tabbed editor for designs including other files
- C-c/C-v should work on the focused widget, not always in the editor
- Auto-indent on enter and on tab
o Error reporting/debugging
- Provide better error messages when polygon ordering causes CGAL errors:
o Detect common error: self-intersecting polyhedron()
o Supply syntax highlighting of the exact polygon indices which are
reported to be wrong
o Provide some interaction for debug walk-through?
- Provide visual highlighting of geometry corresponding to code
-> could aid debugging a lot
- Optionally output console log to a file
- Common error: detect and report (and ignore?) duplicate line segments in DXF
o Computation
- Multi-threaded computation (mostly important for CGAL)
- Progress: Call progresswidget more often to improve feedback
o Misc
- Save: Ask for confirmation if file has been externally changed
- Rename OpenCSG and CGAL to smth. not specific to the underlying libraries
(e.g Preview, Render)
- If trying to export STL/DXF but source is newer than the CGAL rendering, ask
for confirmation.
- Go through keyboard shortcuts and make them more conformant to platform standards
- Show design info/stats (sizes, caches etc.)
- Support Voice Over and related technologies for vision-impaired users
o Cmd-line
- Add verbose option (PRINT command from mainwin.cc and progress output)
OpenCSG-related
---------------
o OpenCSG rendering: Coincident surfaces causes z-buffer fighting. Is this somehow
avoidable tuning the depth tests in OpenCSG?
o When specifying a transparency with the color() statement,
the object is not sorted and will be rendered wrongly. See issue #310 for some good test models.
o Bug: Using the background operator (%) on the only object in a scene triggers a
CSG error: No top level object found
CGAL-related
------------
o Hollow donut problem
When extruding a 2D CSG tree (e.g. a polygon with a hole), the hole
information is lost when performing the extrusion. For linear
extrusions, this has only a minor visual impact, but for rotate
extrusion, the resulting CGAL models will lose the hole. The OpenCSG
rendering keeps the hole, but renders slightly incorrect.
o CGAL issues
- CGAL doesn't handle almost planar polygons. Consider splitting into triangles ourselves. See WillamAdams/dodec.scad
o Look at the EPEC kernel for improved performance (suggested by Giles)
o Look at performance: Is CGAL doing proper bounding box calculation before testing all primitives?
LANGUAGE && BUILTINS
--------------------
o Primitives
- Springs, spirals (requested by Cathal Garvey)
- (TTF) Text
- Image-based height field like http://www.thingiverse.com/thing:2078
- mesh (coordinates and indices)
o 2D Subsystem
- Performance: Is it necessary to union children before extrusion
when compiling? Can this be postponed to CGAL evaluation time?
- Add inset() operation
o Built-in modules
- extrude*: Allow the base 2D primitive to have a Z value
- rotate_extrude(): Allow for specification of start/stop/sweep angle?
o Advanced Transformations
- Add statement for refinement via surface subdivision
- Add statement for intersections in cartesian product of childs
o Function-Module-Interface
- Pass a module instanciation to a function (e.g. for a volume() function)
- Pass a function to a module instanciation (e.g. for dynamic extrusion paths)
o Language Frontend
- Allow local variables and functions everywhere (not only on module level)
- Rethink for vs. intersection_for vs. group. Should for loops
generate child lists instead, and make these passable to other
modules or accessible by child()?
o Misc
- center as default: Very often, center=true is used everywhere.
Make a global variable ($center?) control this to beautify code
and the avoid typical errors when forgetting to specify center
- Go through default values of parameters (e.g. cube() has x,y,z=1 while linear_extrude() has height=100)
- Add support for symbolic names to child() statement
- Add 'lines' object type for non-solid 2d drawings
- Is there a reason why modules like echo, empty if, empty for loop returns an
empty AbstractNode instead of being ignored?
- Dependency tracking of libraries (USE'd modules) isn't implemented. See Mail from nophead 20110823.
o Grammar/Parser
- dim->name -> dim->label
- A random(seed) function
- linear_extrude()/rotate_extrude(): Cumbersome names? -> (extrude, revolve, lathe, sweep ?)
- If a compile error occurs in an included file, line numbers are global
and doesn't say in which file the error occurred.
INFRASTRUCTURE
--------------
o DXF Import/Export
- Use dxflib from RibbonSoft for import/export? -> investigate
- Import
- Support for POLYLINE entity
- Support for SPLINE entity
- Support for LEADER entity
- Support for MTEXT entity ?
- idea: DXF inline - convert from dxf to OpenSCAD syntax -> parametrize dxf content
- Progress when exporting large STLs
o Mesh optimization on STL export
- Remove super small triangles (all sides are short)
- Replace super thin triangles (one h is short)
o Use a logging framework to get debugging/info output more under control?
(check log4j, google project)
o Export to other file formats
- IGES: Should support CSG so it might be possible to keep some structure
IDEAS FOR LANGUAGE CHANGES
--------------------------
o More strict checking of module parameters to make e.g. this fail:
module test(a,b) { a=1; b=2; echo(a,b,c); } test(c=3);
(also for built-in modules)
CODE
----
o Refactor from MainWindow:
- Put all application-global data in one place (QApplication subtype?)
- Fix current_win hack
- CSG data structure (compiled model)
- CGAL data structure (compiled model)
o C++-ify
- Use static_cast/dynamic_cast instead of C-style casts
o dxflinextrude and dxfrotextrude could share code
o Consider decoupling DXF-specific functionality from the 2D subsystem
o Visitation refactoring
- Make AbstractNode members private/protected?
DOCUMENTATION
-------------
o Auto-generate API documentation instead of, in addition to or combined with, the wikibooks docs.
o Clarify include/use better in the wikibook docs (e.g. that use'd modules have to be self-contained)
TESTING
-------
o Caching and MDI looks suspicious when the code relies on external resources
which might be loaded from difference locations in different documents
-> we might get a false cache hit
o Collect "all" available OpenSCAD scripts from the internets and run the integration
tests on them all
MISSING TESTS:
--------------
o cmd-line -D variable override
o OPENSCADPATH env.variable
o all functions
o mirror
o scale
o open polyline from dxf using new method
o linear_extrude DXF
o rotate_extrude DXF
o import_stl
o import_off
o import_*
- open polylines
o include: test subdirs under librarydir (e.g. include <MCAD/gears.scad>)
o variants of module transparent() { %child(); }
o define modules
o define functions
o built-in variables and constants (builtin-tests.scad)
o Caching
- Test that caching is actually performed (speedup + same results)
- Test the modifier characters correctly influence the cache (also when
added/removed)
- Test the individual caches
- PolySetCache
- CGALCache
- nodecache
- ModuleCache
o other tests
- export
- cmd-line tests
- leaf nodes having children, e.g. cube() cylinder();
- dependency tracking (use and include)