6-month Training Summary

During my 6 month training, I worked on three main projects: OpenSCAD’s customizer, sunehaG and TheRoadproject.
Where OpenSCAD being chosen by me as the main project.

So, Let’s start with OpenSCAD’s customizer.

OpenSCAD

OpenSCAD is basically the programmers 3D CAD i.e.  we can create 3D models using programming and the programming language used by it for that purpose is scad. OpenSCAD is mainly used for 3D printing.

SCAD is declarative, a functional programming language which is something like what HTML, CSS, javascript together are for creating the web page but power of all three together in the single language that is specially used for 3D modeling. But It lacked one feature that was the ability to customize the models interactively like in a case of a web page you would have seen an option of zooming and according to which the web page changes or option to change the list view into tables using a widget. So, the similar feature was required in SCAD.
i.e. a syntax to define widget for variable and using that widget to change the value of the variable in the model.

So, this requirement defined the base for my project.

To enhance the syntax of OpenSCAD to make programmer able to define a GUI which would be used to customize the model interactively.

Here, Is the example.

So, Now the main question why we needed this and who needed this:

  1.  Modeler: They need this feature to calibrate the model as its something which is to be 3D printed so, an even difference of 0.001 units make difference and could break your model and 3D printing is not so cheap at this time.
  2.  Client: They need this feature to customize the model according to their needs but they would not know programming to make changes in the program itself. So, they always want a GUI thing for this purpose. Plus we can’t give the user all the variable to change as they might break the model. So, they need to be restricted access in terms of both which variable they can change and which values they can assign to variables.

We provided a user with the following syntax to define different widgets.

    •  Drop down box
    // combo box for nunber
    Numbers=2; // [ 0 , 1 , 2 , 3 ]

    // combo box for string
    Strings= "f o o "; // [ foo , bar , baz ]

    // labeled combo box for numbers
    Labeledvalues =10; // [ 10 : L , 20 :M, 30 : L ]

    //labeled combo box for string
    Labeledvalue="S" ; // [ S : Small , M: Medium , L : Large ]
    •  Slider
// slider widget for number
slider =34; // [10:100]

//step slider for number
stepSlider=2; //[0:5:100]
    •  ComboBox
//description
Variable = true;
    • SpinBox
// spinbox with step size 1
Spinbox= 5;

// spinbox with step size 1
SpinboxWithStep= 5; //3
    •  Text Box
//Text box for vector with more than 4 elements
Vector=[12,34,44,43,23,23];

// Text box for string
String="hello";
    • Vector Widget
//Text box for vector with less than or equal to 4 elements
Vector2=[12,34,45,23];

So, This syntax satisfied our basic need but we needed more.

UX is also important. We want to provide the feature to make it easy for a user to group different variables for making it easy for the user to find them and change them.
So, we needed a syntax to by which programmers would club different Widgets together and the basis on which they need to be clubbed is depended on a programmer.

So, We provided programmers with four type of grouping:

  1. Ungrouped: ungrouped variable is in the separate group called parameters.
  2. Hidden: Hidden group is used to hide certain parameters which we don’t want to appear on customizer. /*[Hidden]*/
  3. Global: the Global group is used to define parameters which are required to come in all the tabs. /*[Global]*/
  4. User defined: These are user-defined groups. /*[ Name which user want to give to group]*/

So, User and Modeller got what they want but what after the model is customized and we have to manually change the values in the program so that they are saved when we open scad file next time and this was a problem for a user but there was a bigger problem. what If we want to save two different set of parameters for the same program. Copy whole programmer again with new set of parameters? No, We have a solution.

Customize the model and then save that set of value of model in JSON file and when you want to use the same set of values. Just choose that set again and the main catch is that you can save as many sets of values in that file as much you like and then choose which set of values you want. The user is provided with the list of the set of values saved and a user can add the new set, update old set and also delete sets.

It would save a lot of time and efforts.

The structure how the values are saved in JSON file.

{
    "parameterSets":
    {
            "fileFormatVersion": "1"
        "set-name":
        {
            "parameter-name" :"value",
            "parameter-name" :"value"
        },
        "set-name":{
            "parameter-name" :"value",
            "parameter-name" :"value"
        },
    },
    "fileFormatVersion": "1"
}

till this point, we have catered two type of users: modelers and normal users but there is one more type of users those who hate GUI at all these could be normal programmers who want to automate things using scripts or even other software which uses OpenSCAD as their back End.

So, the Last piece of work was to provide the cmd line options to customize the work. OpenSCAD already as a rich number of cmd line option which would help you to do mainly anything that can be done through GUI with a cmd line. So, the same thing needed to be replicated for Customizer.

You can write in a JSON file the parameters and values that you want to customize through the cmd line and then run OpenSCAD with following arguments.

openscad --enable=customizer -o <output file> -p <Example file> -P <Name of set> <Input file>
 

and it will apply that to the model.

and that’s it about my project of openSCAD’s customizer.

Finally, I would like to present the implementation details of the customizer:

  1. Front end
    It will deal with how the parameter will look to the user like in form of range or spinbox etc. This part will include two parts:

    • Individual Parameter:
      This will define how individual parameters will look like
    • Container Widget:
      This will contain UI features common to all parameter. This widget will contain all parameter widget.
  2. BackEnd: This will include the parser part that will create AST nodes and we can extract the parameters from the AST. we can use the single parser for the whole .the scad file or separate parser for extracting the parameters with annotations. The Back-end part will also include the parameter extractor and injector or the injector can be included in parameter object which will serve as interface
  3. Interface: This will include the parameter object which will serve as an interface between both Backend and Frontend. Parameter object will contain information regarding each individual parameter like parameter name, default value, and information how this parameter will be displayed as widgets to the user. Parameter object could also include the method to inject the value of the individual parameter into the AST.h

With this, I end my first project.

sunehaG

Next is sunehaG, I will not go into much detail about this. Just want to say that I will be an official messaging app of GNDEC (our college) and is currently deployed on college server and a beta version is available on play store.

It provided features which are basically the combination of the telegram and WhatsApp. Some important features of this app are:

  1.  Support multiple users on the same device.
  2. Allow the single user to login on multiple devices.
  3. Encryption.
  4. Send files of any type.
  5. No need to create an account just use you college id and password.
  6. Already made groups according to groups in which you would be divided in college.
  7. Change the message that had been sent.

Work which I did in this app is basically customizing to our need and configuring the server, comparing different clients and server available that could be used by us and then choosing the most suitable one and then converting it from general purpose app to specific purpose app like we only wanted our college students to use this app and they need not create their new account. So, We took the option of signing in and connected it to our college server and much more customizations, configuration, and scripts.

This app will be realeased in next semester officially and might be even with web client also.

The Road Project

The last project that I worked on was The Road Project.

This was the project to automate the analysis of the road. In simple language, This project intends to provide civil engineers from where could be found from which place soil needs to fill and where they need to extracted to make road plain.

In this project, the user will provide the following data files and with the following information:

  1.  Data points (x,y) to specify the shape of a road: This file will be used to interpolate the required points on road then extrapolate the points perpendicular to that part of a road on both side corresponding to the interpolated point and then save this data in a file for use in the final step.
  2. Survey points: These are the points collected by the civil engineers that are x,y,RL points where x,y tells the location of point and RL tells the level at that point.

We need to write a script which does the following work:

  • Feed the given data points to GRASS.
  • Then tell GRASS to interpolate RL values for the whole area.
  • Then make contours.

But There was the problem that It would require the very sophisticated machine to do this task and our systems were incapable of doing this work. So, to overcome this problem we divided area to be interpolated into small units and then computed them.

After above processing is done on data we need to extract the required data i.e. RL values on the path of the road and between the sections that were defined in the first step using the set of extrapolated values.

So, we feed the GRASS the data created in the first step and then told it to write the output values in the file and corresponding to this process the 25mb of plain text data was generated which huge amount it’s basically more than 40 lakh data points and 1201 files for 12 km road. Then this data was fed to another software which generated the graphs and these were used by civil engineers.

The main benefit of doing above work through scripting was that same work could be done again in future for any data. In just an hr, without any human involvement which otherwise could have taken more than a week if done manually.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s