Makelangelo update #44

Shop Forum Makelangelo Polargraph Art Robot Makelangelo update #44

  • This topic is empty.
Viewing 13 posts - 26 through 38 (of 38 total)
  • Author
    Posts
  • #6658
    Anonymous
    Inactive

    Yeah I put in 500 500 and it changed it. Looks like a rounding error.

    problem at line 178 in MachineConfiguration.java maybe?

    float pwf = Math.round( Float.valueOf(pw.getText()) * 100 ) / (100 * 10);
    float phf = Math.round( Float.valueOf(ph.getText()) * 100 ) / (100 * 10);
    float mwf = Math.round( Float.valueOf(mw.getText()) * 100 ) / (100 * 10);
    float mhf = Math.round( Float.valueOf(mh.getText()) * 100 ) / (100 * 10);

    Seems to round to the tens place.

    EDIT: no it truncates the ones place it does not round. Need to do real division not integer division.

    #6659
    Anonymous
    Inactive

    I changed the variables to double instead of floats (and their garbage division) and divided by a real number. Not sure if you needed to be float?

    double pwf = Math.round( Float.valueOf(pw.getText()) * 100 ) / (100.0 * 10);
    double phf = Math.round( Float.valueOf(ph.getText()) * 100 ) / (100.0 * 10);
    double mwf = Math.round( Float.valueOf(mw.getText()) * 100 ) / (100.0 * 10);
    double mhf = Math.round( Float.valueOf(mh.getText()) * 100 ) / (100.0 * 10);

    OR since we lost memory space by making them doubles (128 bits more for 4 numbers) we can optimize speed by changing division to multiplication LOL

    double pwf = Math.round( Double.valueOf(pw.getText()) * 100 ) * (.001);
    double phf = Math.round( Double.valueOf(ph.getText()) * 100 ) * (.001);
    double mwf = Math.round( Double.valueOf(mw.getText()) * 100 ) * (.001);
    double mhf = Math.round( Double.valueOf(mh.getText()) * 100 ) * (.001);

    School is out for this teacher… so bored 😀

    #6660
    Anonymous
    Inactive

    @pkm wrote:

    I just looked at it. Here’s new start32.bat file, please check on Windows 32bit. Works for me on Windows 64bit 🙂


    :: special thanks to http://rgagnon.com/javadetails/java-0642.html
    :: http://stackoverflow.com/questions/638301/discover-from-a-batch-file-where-is-java-installed
    @echo off
    cls
    setlocal ENABLEEXTENSIONS
    ::
    :: get the current java version
    ::

    :CheckOS

    IF EXIST "%PROGRAMFILES(X86)%" (GOTO 64bit) ELSE (GOTO 32bit)

    :64bit

    FOR /F "skip=2 tokens=2*" %%A IN ('REG QUERY "HKLMSoftwareWow6432NodeJavaSoftJava Runtime Environment" /v CurrentVersion') DO set CurVer=%%B

    FOR /F "skip=2 tokens=2*" %%A IN ('REG QUERY "HKLMSoftwareWow6432NodeJavaSoftJava Runtime Environment%CurVer%" /v JavaHome') DO set JAVA_HOME=%%B

    GOTO endos

    :32bit

    FOR /F "skip=2 tokens=2*" %%A IN ('REG QUERY "HKLMSoftwareJavaSoftJava Runtime Environment" /v CurrentVersion') DO set CurVer=%%B

    FOR /F "skip=2 tokens=2*" %%A IN ('REG QUERY "HKLMSoftwareJavaSoftJava Runtime Environment%CurVer%" /v JavaHome') DO set JAVA_HOME=%%B

    :endos

    if defined JAVA_HOME (
    @echo The current Java runtime is %CurVer%
    ) else (
    @echo Java not found.
    @pause
    goto end
    )

    "%JAVA_HOME%binjava.exe" -classpath RXTXcomm.jar -Djava.library.path=32 -jar Makelangelo.jar

    :end

    Please note that I also moved @pause so that the command prompt window does not remain after the software is closed
    (it was pretty annoying).

    Thank you! Not sure how to test this before I share it with everyone.

    #6661
    Anonymous
    Inactive

    I only added a check for Win 64bit, now it starts the software from both 32bit and 64bit apps, i.e. problem solved.

    For Win 32bit there was no problem, I’m 99% sure it won’t appear. Though I’ll try to find a PC with Win 32bit to check.

    #6662
    Anonymous
    Inactive

    I see on the last line it says

    "%JAVA_HOME%binjava.exe" -classpath RXTXcomm.jar -Djava.library.path=32 -jar Makelangelo.jar

    but for 64 bit systems is should be

    "%JAVA_HOME%binjava.exe" -classpath RXTXcomm.jar -Djava.library.path=64 -jar Makelangelo.jar
    #6663
    Anonymous
    Inactive

    My guess is start32 for java32 and start64 is for java64.

    The problem is Windows 64bit can have java 32 or 64 or both installed.
    New start32.bat correctly finds and starts java32 on Windows 64bit from both 32bit or 64bit app.

    And start64.bat launches java64 on Windows 64 bit, that’s no problem.
    Though! Actually start64 won’t launch from 32bit app on Windows 64 (rare situation), I should correct it too.

    #6664
    Anonymous
    Inactive

    Or, should I write the only file start.bat?
    Which launches java32 on win32, for win64 tries to find java64, then java32.

    #6665
    Anonymous
    Inactive

    In a perfect world we wouldn’t need bat files or that start.command for OSX. It would be as easy as Minecraft – an executable that *just runs* and downloads updated jars automatically.

    No idea how to do that.

    #6666
    Anonymous
    Inactive

    I actually have no clue, but there are a few things to try
    http://stackoverflow.com/questions/2011664/compiling-a-java-program-into-an-exe

    #6667
    Anonymous
    Inactive
    #6668
    Anonymous
    Inactive

    Any option to remove “Makelangelo #” text below the drawing?

    #6669
    Anonymous
    Inactive

    More about text:
    1. “Text to GCODE” worked for me, but the software won’t open a text file.
    2. If I made Cyrillic gcodes, would it convert Cyrillic texts?

    Also, is it possible to move “Open file” to upper level? It’s hard to find and hard to choose.

    Thanks!

    #6670
    Anonymous
    Inactive

    Usually at a show I’m doing the same pictures over and over so I pick from the top ten menu.
    How’s this instead?

    The text to GCode system isn’t that sophisticated yet. In theory someone could use

    http://docs.oracle.com/javase/7/docs/api/java/awt/Font.html#layoutGlyphVector%28java.awt.font.FontRenderContext,%20char%5B%5D,%20int,%20int,%20int%29

    and

    http://docs.oracle.com/javase/7/docs/api/java/awt/font/GlyphVector.html#getOutline%28%29

    and

    http://docs.oracle.com/javase/7/docs/api/java/awt/Shape.html#getPathIterator%28java.awt.geom.AffineTransform%29

    and

    http://docs.oracle.com/javase/7/docs/api/java/awt/geom/PathIterator.html#currentSegment%28double%5B%5D%29

    to get the lines needed to draw any character in any font. Then someone would also have to write code to handle

    SEG_MOVETO
    SEG_LINETO
    SEG_QUADTO
    SEG_CUBICTO
    SEG_CLOSE

    (see last link)

    Another way might be to save your text from Inkscape as an R12 DXF and then write a plugin to convert R12 DXF files to GCODE. That way Makelangelo could piggy back on the power of many other art programs.

    Recently I’ve been working on gearboxes for the robot arm

    https://www.marginallyclever.com/other/hypocycloid-generator.html

    and I learned how to read/write R12 DXF files

    http://www.mediatel.lu/workshop/graphic/3D_fileformat/h_dxf12.html

    You might also find the information useful.

    I can’t promise I’ll add either of these ideas any time soon, but if you write a plugin that works I would be delighted to pop it in and make sure you get full credit for your work.

Viewing 13 posts - 26 through 38 (of 38 total)
  • You must be logged in to reply to this topic.