ScorchCAD Released on Google Play

ScorchCAD_444

ScorchCAD (A clone of OpenSCAD for Android devices) is now available on Google Play: ScorchCAD.  There is also a new ScorchCAD webpage here: ScorchCAD Web Page.  I will continue to work on supporting more features in future releases.  below are the details from the Google Play listing.

ScorchCAD is a clone of OpenSCAD written for Android devices.  This program executes OpenSCAD code and displays the resulting 3D model.  ScorchCAD aims to provide the same functions as OpenSCAD but it does not use the same source code. Most of the basic features are currently working. Additional features will be supported in future updates.

Features currently supported (fully or partially):
- Shapes: cube, cylinder, sphere
- Transformations: translate, rotate, scale, color
- Boolean Operations: union, difference and intersection
- File Import: DXF and STL (ASCII and binary)
- User defined variables and special variables : $fa, $fs and $fn
- User defined functions and Math functions

ScorchCAD is still a work in progress here is a partial list of the OpenSCAD features not yet supported:
rands, min, max, multmatrix, hull, minkowski, polygon, polyhedron, intersection_for, assign, projection, surface, render, children, lookup, str, search, version, version_num, norm, cross, parent_module, Modifier Characters (* disable, ! show only, # highlight, % transparent)

shot_000005

ScorchCad Preview (Update 2)

 

This is my second short update of my progress on ScorchCAD (A clone of OpenSCAD for Android devices).  I am slowly adding more features and improving the user interface.  I have also been testing with some of the sample files provided with OpenSCAD (see the animated GIF) Here are some of the recent improvements:

  • Separated the input editor from the viewer screen and added a separate console screen  for messages.
  • Added support for FOR loops
  • Read and write STL files (see the frog in the GIF animation)
  • Read 2D DXF files and extrude 2D shape into 3D shape
  • Zoom and pan support for the viewer window

Using F-Engrave with GRBL

F-Engrave

I have had some feedback from ShapeOko users indicating that there are some issues using the default F-Engrave output with GRBL.  I thought I would take some time and describe the problems that people are having and discuss the F-Engrave settings needed to produce g-code that GRBL can run.

First, F-Engrave defines variables for the feed rate and engraving cut depth that are not compatible with GBRL.  This problem can be solved by checking the “Disable Variables” check box in the F-Engrave Settings window.  This will prevent F-Engrave from writing the incompatible variables to the g-code output file.

Second, F-Engrave uses incremental distance mode for arcs.   In order to ensure that g-code interpreters read the data correctly the code G91.1 is set in the g-code output (setting the arc distance mode to Incremental).  Unfortunately GRBL does not support reading the G91.1 code. To eliminate the incompatible G91.1 code from the F-Engrave output F-Engrave users need to un-check the “Enable Arc Fitting” option in the F-Engrave Settings window.  (Alternatively the G91.1 code can be manually removed from the g-code file.)

Update: Apparently GRBL misreading the G91.1 code also results in the next g-code line, which set the units (in or mm), being skipped/misread.  I also see there is some discussion about fixing the G91.1 g-code problem on the ShapeOko forum.

I recently updated F-Engrave to suppress writing the G91.1 code when arc fitting is disabled so be sure to use F-Engrave version 1.34 or higher to make sure the G91.1 is not written by F-Engrave.

In summary, to generate g-code compatible with GRBL:

  • Select the “Disable Variables” check box in the F-Engrave Settings window
  • un-select the “Enable Arc Fitting” check box in the F-Engrave Settings window
  • Use F-Engrave version 1.34 or higher

These settings (and all of the other settings) can be saved and loaded every time F-Engrave starts up.  See the F-Engrave Manual for more details on the F-Engrave configuration file.

G-Code to DXF with G-Code Ripper

G-Code Ripper

G-Code Ripper Version 0.05 is now available.  The new version can export tool paths read from a g-code file to a DXF or CSV (Comma Separated Value) file.  The new features are located under a new G-Code Operations option called “Export”.

In the exported DXF file rapid moves and controlled moves are written to different layers with different color indexes. The rapid moves can also optionally be omitted from the G-Code Ripper DXF output.

All of the arcs (G2/G3 moves) are converted to multiple linear segments for now. I will include arc output to the DXF file if there is interest as time permits.

 

ScorchCad Preview (Update 1)

ScorchCAD Demo ScorchCAD Snowman ScorchCAD Lego

This is a quick update of my progress on ScorchCAD (A clone of OpenSCAD for Android devices).  I am slowly adding features.  So far I these are the items that are working:

  • Basic shapes (cube, sphere and cylinder)
  • Basic boolean operations
  • Colors
  • OpenSCAD file opening and saving using file dialogs
  • Support for variables is partially complete (I need to make set at compile time as are in OpenSCAD)

The pictures above are small models that I made using ScorchCAD while I was waiting for my kids hockey games to start.

Simple File Dialog For Android Applications

Since there isn’t a built in file dialog interface for android development I have been searching for one that I could use without starting from scratch. I did eventually find a Simple Directory Chooser with a very lenient license (The Code Project Open License (CPOL) 1.02). The directory chooser I found uses a dialog interface so there is no need to create an additional activity to use it.

The directory chooser was great but I needed a file dialog for choosing files for opening and saving not a directory chooser. To get the file dialog I needed I modified the original directory chooser adding to it as needed to create a Simple File Dialog for my own use. I thought I would post my modified version here for others to use or build on.

The file dialog code consists of a single file and uses standard Android resources. This file dialog code should be very portable and easily inserted into any project to add menu driven file selection within Android.  Screen shots of the three file dialog modes (Open, Save, and Folder Select) are shown below. The “Save” and “Folder Select” modes include a button for adding a new folder to the file structure.

Open Dialog save folder

The code can be downloaded here: SimpleFileDialog.java and MainActivity.java

Bare Bones Application Using the Simple File Dialog

This is a very bare bones application with three buttons that call the Simple File Dialog in all three modes (Save, Open and Folder Select). To make this application I just started a new Android Application Project in Eclipse. Edited the Layout to add three buttons and edited the MainActivity.java file. The finished MainActivity.java file is shown below.

Demo Screen

//MainActivity.java
package com.scorchworks.demo;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;

import android.widget.Button;
import android.view.View.OnClickListener;
import android.widget.Toast;

//import android.view.View;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		//Button1
		Button dirChooserButton1 = (Button) findViewById(R.id.button1);
		dirChooserButton1.setOnClickListener(new OnClickListener() 
		{
			String m_chosen;
			@Override
			public void onClick(View v) {
				/////////////////////////////////////////////////////////////////////////////////////////////////
				//Create FileOpenDialog and register a callback
				/////////////////////////////////////////////////////////////////////////////////////////////////
				SimpleFileDialog FileOpenDialog =  new SimpleFileDialog(MainActivity.this, "FileOpen",
						new SimpleFileDialog.SimpleFileDialogListener()
				{
					@Override
					public void onChosenDir(String chosenDir) 
					{
						// The code in this function will be executed when the dialog OK button is pushed 
						m_chosen = chosenDir;
						Toast.makeText(MainActivity.this, "Chosen FileOpenDialog File: " + 
								m_chosen, Toast.LENGTH_LONG).show();
					}
				});

				//You can change the default filename using the public variable "Default_File_Name"
				FileOpenDialog.Default_File_Name = "";
				FileOpenDialog.chooseFile_or_Dir();

				/////////////////////////////////////////////////////////////////////////////////////////////////

			}
		});

		//Button2
		Button dirChooserButton2 = (Button) findViewById(R.id.button2);
		dirChooserButton2.setOnClickListener(new OnClickListener() 
		{
			String m_chosen;
			@Override
			public void onClick(View v) {
				/////////////////////////////////////////////////////////////////////////////////////////////////
				//Create FileSaveDialog and register a callback
				/////////////////////////////////////////////////////////////////////////////////////////////////
				SimpleFileDialog FileSaveDialog =  new SimpleFileDialog(MainActivity.this, "FileSave",
						new SimpleFileDialog.SimpleFileDialogListener()
				{
					@Override
					public void onChosenDir(String chosenDir) 
					{
						// The code in this function will be executed when the dialog OK button is pushed
						m_chosen = chosenDir;
						Toast.makeText(MainActivity.this, "Chosen FileOpenDialog File: " + 
								m_chosen, Toast.LENGTH_LONG).show();
					}
				});

				//You can change the default filename using the public variable "Default_File_Name"
				FileSaveDialog.Default_File_Name = "my_default.txt";
				FileSaveDialog.chooseFile_or_Dir();

				/////////////////////////////////////////////////////////////////////////////////////////////////

			}
		});

		//Button3
		Button dirChooserButton3 = (Button) findViewById(R.id.button3);
		dirChooserButton3.setOnClickListener(new OnClickListener() 
		{
			String m_chosen;
			@Override
			public void onClick(View v) {

				/////////////////////////////////////////////////////////////////////////////////////////////////
				//Create FileOpenDialog and register a callback
				/////////////////////////////////////////////////////////////////////////////////////////////////
				SimpleFileDialog FolderChooseDialog =  new SimpleFileDialog(MainActivity.this, "FolderChoose",
						new SimpleFileDialog.SimpleFileDialogListener()
				{
					@Override
					public void onChosenDir(String chosenDir) 
					{
						// The code in this function will be executed when the dialog OK button is pushed
						m_chosen = chosenDir;
						Toast.makeText(MainActivity.this, "Chosen FileOpenDialog File: " + 
								m_chosen, Toast.LENGTH_LONG).show();
					}
				});

				FolderChooseDialog.chooseFile_or_Dir();

				/////////////////////////////////////////////////////////////////////////////////////////////////

			}
		});

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
//

For the New Folder button to actually create a new folder in the demo you need to include the following line in the Manifest file to give the app permission to write to the SD Card.

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

None of this code would have been possible without the jump start I got from the Simple Directory Chooser

F-Engrave 1.33

F-Engrave

I uploaded version 1.33 of F-Engrave, it is available on my web page. (F-Engrave 1.33)

Changes in Version 1.33:
- Added option for scaling input image height as a percent of the input values (rather than imputing the height as a length unit). This new feature should help people that combine more than one image together in a project. The new option is “Set Height as %” which allows scaling the input image by a percentage rather than setting a size(in or mm) for the height. Setting the height % to 100 will result in the image being the same size as the imported DXF file.

- Fixed batch mode…again. (I should really check that it is working before each new release)

Simon Hack a Day’ing

Simon
Hack a Day is having another contest.  This time it is a microcontroller based contest.  The entries need to hide hackaday.com in a microcontroller project as an Easter egg.  The extent of my experience with microcontrollers was soldering together at a Simon project at a Maker Faire a few years back.  I have been meaning to buy an FTDI board to program the Simon for a while now but never seemed to get around to it.  When the Hack a Day contest launched I decided now was the time to give it a shot.

A few days later with the FTDI in hand it was time to start creating my Easter egg.  I downloaded the original source code for the Simon (available on the Sparkfun web site) and started adding my own code to incorporate the Hack a Day URL.  What I came up with is a fully functional Simon game with a couple of minor twists.  The first change is that when Simon is playing the sequence of buttons for the player to repeat.  The sequence is played by Simon in an irregular pattern which is actually Morse code for “hackaday.com”.  When playing the game it is clear that the timing is a little off but it hard to tell it s Morse code because the tones change with the different colored buttons.  The video below shows the Simon playing with the modified program.

Game Play Video: Game Play Video Direct Link

Since I am not great at playing the Simon game I added another method to generate the full Morse code for “hackaday.com”.  Usually to start the Simon game the player needs to push one of the buttons to initiate the beginning of a new game.  I modified the program to detect if two buttons are pressed rather than one.  With the modified program when two buttons are pressed at the same time the Morse code it pulsed out prior to the game starting.  The video below shows the full Hack a Day URL being played by Simon.

Two Button Press Video: Two Button Press Video Direct Link

I have uploaded my modified code here: Simon_Game_Code_with_morse_code.ino. I included all of the letter codes in my look-up function so the Morse code message can easily be changed.  The length of the game is automatically adjusted to the length of the string entered in the egg array.

 

F-Engrave V1.32

F-Engrave

F-Engrave Version 1.32 is now available on the F-Engrave Web Page.  This release includes a few minor items that I have had backlogged for a while.  The items are listed below.

- Added limit to the length of the engraved text included in g-code file comment (to prevent error with long engraved text)

- Changed number of decimal places output when in mm mode to 3 (still 4 places for inches)

- Changed g-code format for G2/G3 arcs to center format arcs (generally preferred format)

-Hard coded G90 and G91.1 into g-code output to make sure the output will be interpreted correctly by g-code interpreters.

Scissors

Composite Repair and Reinforcement

Sometimes a  broken part was generally too weak to begin with or does not have much surface area for bonding.  To achieve a  good repair additional material needs to be added to supply more strength or surface area for bonding.  One way that I have used to provide the additional material has been to wrap string around the parts and bond the assembly together into one solid mass.  This is essentially a low tech composite material.  The resulting repairs are very strong.  The scissors in the picture above has taken much more abuse after the repair than it did before it initially broke.  I regularly use the scissors to cut cardboard and whatever else gets in my way in my shop.

Embedded below is a video detailing this method being applied to the handles on a cheap dial indicator stand.

In addition to repairs this technique can be used to reinforce items that are likely to fail before they are put into service.  The picture below shows a toy that I made for my kids (Lord Garmadon’s staff).  The two pieces of wood are joined in such a way that the staff would likely split along the grain if not reinforced.  For this item I used school glue and kite string.

 Lord Garmadon's StaffLord Garmadon's Staff (full)

The first time I ever saw this method used was in a model airplane.  In the airplane there were push rods running from the servos to the control surfaces.  The ends of the push rods were made from steel piano wire and the middle of the push rods were made from balsa wood.  In order to secure the piano wire to the balsa the instructions detailed how to overlap the piano wire and balsa then wrap the overlapping region with string coated with glue.   The procedure produced a very solid push rod assembly.

I have found this to be a reliable method to repair and join parts.  I hope you find it useful too.