8 votes

Rendering primitive 2D shapes

Your use of underscores to prefix methods is not a good idea since they are reserved. The lack of comments through out the code mean that it is more difficult to read than it should be. You should ...
  • 1,532
6 votes

Python module to print in printer

Wrong Conceptual Model An interesting module, but you need to rethink it a bit. It is a print context, not a document. A document would hold things like paragraphs, images, charts, and what not. ...
  • 32.2k
4 votes

Shorten a SVG file created with Inkscape

SVG is written in XML. As a rule, you should prefer using proper XML tools to process XML rather than doing ad hoc text substitutions, for robustness and maintainability. Look into using XSL ...
2 votes

Rendering primitive 2D shapes

Small things The first line comment appears to be instructions on how to compile. If you plan on expanding the project beyond this, maybe it is worth making compilation commands into a Makefile. Don'...
  • 996
1 vote

Create normals from triangulated surface

It's not only the "slow block" you indicated that needs refactoring; it's basically everything. As a beginner, assume that you may never use for loops when writing Numpy code otherwise you'...
  • 53.7k
1 vote

Android + Kotlin advanced color picker (HSV and RGB)

Reduce nesting of if's, that surround whole method, I suggest you instead use negative if's with return in onDraw. Or you can at least merge them into single if (or combine as I did): ...
  • 1,448
1 vote

Radial gradient image generator

Things I changed: x * x is faster than x.pow(2) f64 is way overkill for this, use ...
  • 436
1 vote

Generate vertices and normals for a flat shaded cylinder

Some suggestions: Separate generating the mesh from printing the mesh. i.e. return a Mesh class from the generator function and write a separate ...
1 vote

Hough Circular Transform

Better algorithms I'm not quite a specialist in this area; so I assume you have selected the best possible algorithm and the best possible parameters, so microoptimizations are the only thing left to ...

Only top scored, non community-wiki answers of a minimum length are eligible