Skip to content

Week 14


Assignment - Interface And Application Programming

  • Group assignment:

    • Compare as many tool options as possible.
    • Document your work on the group work page and reflect on your individual page what you learned.
  • Individual assignment:

    • Write an application for the embedded board that you made. that interfaces a user with an input and/or output device(s)

See Assignment Details


Group Assignment

Comparison

  • Grasshopper
  • Python (first test)
  • P5JS
  • FreeCAD Macro

Reflection

  • Grasshopper script runs inside Rhino, which is a proprietry software, and makes the script less accessible.

    • I investigated Grasshopper Player, which allows you to run a script headlessly, and I made aliases for commands, so they became like normal Rhino commands!
  • Python was able to do everything but not easy (to me) or optimised at anything without additional libraries IMO. Python needed a library (I was suggested Trimesh) to do intersections. I was out of depth with my python experience.

  • P5JS was fantastic for web interface. And I could embed directly using an iframe. It successfull works to upload a mesh file, can analise. We can get bounding box dimensions, and report if that matches a supposed machine size, and what proportional scale to fix it. However, core P5JS didn’t have an efficient way to do the slicing, and for the preview required iterating all triangles in the mesh and renormalising. When initiating a WebGL (3D) canvas, the text becomes a 3D text object, and is affected by transforms (even within push/pop commands!). So, a library should be used that can handle this.

  • FreeCAD can run a Macro. I relied on AI to rewrite this for me, using the first script as an example. I could add a macro to the toolbar, and text very easily. Using AI was a mistake, because I didn’t understand enough of the script to tell what was going on. Apparently slicing a 3D object produced “wires” and not polylines, and I didn’t manage to convert and flatten these lines in the time allocated.

Write an application (that interfaces with an input or output device)

Files