Git Product home page Git Product logo

Comments (3)

VanessaE avatar VanessaE commented on August 29, 2024

This is a useful tool to me as well, and I agree with you that the color range is not useful.

I would say a continuous black-blue-green-yellow-orange-red-purple gradient (i.e. similar to a weather radar display) is a better idea, with black remaining the lowest-valued color.

from gcodeviewer.

VanessaE avatar VanessaE commented on August 29, 2024

Is this ever going to get fixed? come on guys.

from gcodeviewer.

dartrax avatar dartrax commented on August 29, 2024

This is really annoying. In fact, the "Extrude speeds in mm³/sec"-info is nearly unusably in my opinion.

I was looking for a quick&dirty way to fix it to be able to get mm³/sec for a specific gcode i'm working on. It is far from perfect, but with a few simple steps, you can use it for yourself:

  1. Click the green "Clone or Download"-button and "Download ZIP" to get your copy of the files.
  2. Extract to any folder you like.
  3. Put a textfile in it, call it "start.cmd", and save the following command line:
    start chrome %~dp0index.html --allow-file-access-from-files --user-data-dir=%~dp0Chrome-TEMP\
  4. Open \js\renderer.js and insert this line after line 286:
    speedIndex = Math.round((renderOptions["colorLineLen"]-1)* ((extrusionSpeeds[speedIndex]-Math.min.apply(null, extrusionSpeeds))/(Math.max.apply(null, extrusionSpeeds)-Math.min.apply(null, extrusionSpeeds))));
  5. Open \js\ui.js and go to line 101. Insert a new line
    var extrusionSpeeds = GCODE.gCodeReader.getModelInfo().extrusionSpeeds;
  6. Go to line 115. Replace
    if(speedIndex > colorLen -1){speedIndex = speedIndex % (colorLen-1);}
    by
    speedIndex = Math.round((renderOptions["colorLineLen"]-1)* ((extrusionSpeeds[speedIndex]-Math.min.apply(null, extrusionSpeeds))/(Math.max.apply(null, extrusionSpeeds)-Math.min.apply(null, extrusionSpeeds))));
  7. Save everything and open start.cmd. It will launch a new chrome instance that has access to the javascript sources by the --allow-file-access-from-files flag. Now it will look like this:

image

I know it's not perfect but usable.
If anyone has the time to improve the math, please do it. You can't say you didn't know how to start ;-)

Currently it takes the values of all layers into account, this is why you do not see all 8 available colors in every layer. To fix this, one needs to replace extrusionSpeeds[speedIndex] by extrusionSpeedsByLayer[z][speedIndex], I think...

PS: For convenience, the whole thing is attached as gCodeViewer-master.zip. Download, extract, "start.cmd", enjoy.

from gcodeviewer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.