Source files and CAD files are available in these two repositories: For OpenSCAD: <https://github.com/felipe-m/oscad_filter_stage> For FreeCAD: <https://github.com/felipe-m/freecad_filter_stage>.

Introduction {#sec001}
============

Over the last years there have been a movement towards creating and sharing Open Source Hardware (OSH). This trend has been empowered by open source hardware projects such as the RepRap 3D printers \[[@pone.0225795.ref001]\] and the Arduino platform \[[@pone.0225795.ref002]\], which have made manufacturing and electronic technology accessible and affordable. As a result to this movement many efforts have been made to define open source hardware and set its best practices \[[@pone.0225795.ref003]\] \[[@pone.0225795.ref004]\] \[[@pone.0225795.ref005]\].

Inspired by this movement, an engineering research area has emerged to develop open source scientific hardware and laboratory equipment \[[@pone.0225795.ref006]\] \[[@pone.0225795.ref007]\] \[[@pone.0225795.ref008]\] \[[@pone.0225795.ref009]\] \[[@pone.0225795.ref010]\]. Open source scientific hardware not only allows a more affordable laboratory equipment, but also contributes to the development of Open Science by facilitating the replication and comparison of the scientific experiments. Moreover, it favors the enhancement of experiments by letting others to improve and customize the devices for different purposes.

As stated in the Open Source Hardware Statement of Principles \[[@pone.0225795.ref003]\], open source hardware is hardware for which the design is made publicly available so that anyone can study, modify, distribute, make, and sell the design or hardware based on that design.

Making OSH is not a matter of just providing an open source license for the hardware; in addition, design files, documentation and any source code should be available in the preferred format for making modifications to them and with an acceptable open license. Furthermore, it is encouraged that these files are made editable with free and open source software (FOSS) \[[@pone.0225795.ref004]\] \[[@pone.0225795.ref007]\] \[[@pone.0225795.ref011]\] \[[@pone.0225795.ref012]\].

Ideally, in order to maximize the ability of individuals to use and make the hardware, open source hardware should provide unrestricted content, and use readily-available components and materials, standard processes, open infrastructure and open-source design tools \[[@pone.0225795.ref003]\] \[[@pone.0225795.ref007]\].

The Open Source Hardware Definition \[[@pone.0225795.ref003]\] is based on the Open Source Definition for Open Source software (OSS) \[[@pone.0225795.ref013]\] and adapted to the realms of tangible things. However, there are some aspects of hardware that differ from software. First, unlike software, most of a hardware project will fall within the scope of patent law rather than copyright law \[[@pone.0225795.ref014]\]. Secondly, hardware designs demand a wider range of expertise because new areas of knowledge are involved, particularly when including mechanics, electronics and software \[[@pone.0225795.ref015]\] \[[@pone.0225795.ref016]\].

And lastly, the source in hardware is not as clearly defined as in software, as Bonvoisin et al. show from their study of several OSH products \[[@pone.0225795.ref005]\]. Their analysis reveals a wide range of interpretations of open source hardware, exposing that many projects lack enough documentation to replicate or modify the product.

This last issue unveils one of the main problems for OSH: the deficiency in documentation to consider it truly open \[[@pone.0225795.ref005]\] \[[@pone.0225795.ref015]\] \[[@pone.0225795.ref017]\]. Bonvoisin et al. \[[@pone.0225795.ref005]\] assert that while software source code unambiguously defines the software, i.e. the product; the source for tangible things is not so clearly defined. Consequently, unlike OSH, the openness of OSS is implicitly fulfilled just by providing the source code. Although this statement can be considered accurate; it could nevertheless be argued that proper documentation for OSS is also a need, especially for large projects \[[@pone.0225795.ref018]\] \[[@pone.0225795.ref019]\]. It is unpractical to try to understand large and complex OSS projects without adequate documentation. The 2017 Open Source GitHub Survey supports this idea by highlighting that incomplete documentation is the biggest concern for OSS \[[@pone.0225795.ref020]\].

In addition to the stated OSH requirements, Oberloier et al. \[[@pone.0225795.ref007]\] encourage parametric design of OSH for scientific equipment. Parametric design enables customization by providing the flexibility to alter the model dimensions for other experimental purposes. Parametric models can be created using script-based computer-aided design (CAD) tools such as OpenSCAD \[[@pone.0225795.ref021]\]. OpenSCAD is an open source software tool that may be considered the defacto standard for OSH parametric design \[[@pone.0225795.ref008]\] as it has been widely used to create parametric OSH for laboratory equipment \[[@pone.0225795.ref007]\] \[[@pone.0225795.ref008]\] \[[@pone.0225795.ref022]\] \[[@pone.0225795.ref023]\] \[[@pone.0225795.ref024]\] \[[@pone.0225795.ref025]\] \[[@pone.0225795.ref026]\] \[[@pone.0225795.ref027]\].

The benefits of using a script-based CAD tool such as OpenSCAD are twofold. First, it allows model customization by means of a parametric design. Secondly, it provides a source code for the mechanical design, making it more similar to software. Thereby, addressing the hardware absence of source code that Bonvoisin et al. pointed out \[[@pone.0225795.ref005]\]. Having a source code for the hardware may mitigate the difficulties of OSH projects in defining their true openness. Besides, it allows OSH projects to use software management tools such as control version, software documentation and collaborative tools. In a way, the mechanical design would be similar to the electronic design of digital circuits with hardware description languages; although in the electronic field there is less availability of FOSS design tools to cover the whole process \[[@pone.0225795.ref016]\] \[[@pone.0225795.ref028]\]

Unfortunately, one of the major limitations of OpenSCAD is its inability to export to industry standard CAD file formats such as STEP \[[@pone.0225795.ref029]\] \[[@pone.0225795.ref030]\]. Although OpenSCAD can export the models to tessellated formats that can be read in most CAD tools, these formats are only approximate because they have lost their parametric dimensions. As many authors suggest \[[@pone.0225795.ref012]\] \[[@pone.0225795.ref016]\] \[[@pone.0225795.ref031]\] \[[@pone.0225795.ref032]\], providing a standard file format is crucial since it allows others to modify the OSH design with different CAD tools. This is a critical issue since the user may not be familiar with a script-based CAD tool such as OpenSCAD.

In this paper we review script-based FOSS CAD tools in order to find an alternative to OpenSCAD. Among these tools, we have found FreeCAD \[[@pone.0225795.ref033]\] to be a suitable candidate, since it is able to export to standard parametric CAD formats. Although FreeCAD is mainly used through its graphical user interface (GUI), it also allows creating CAD models using Python programming language \[[@pone.0225795.ref034]\]. Therefore, in this paper we analyze OpenSCAD, which is the most extensively used tool for modeling open scientific equipment with a programming language, and compare it with Python scripts for FreeCAD (hereafter FreeCAD Python).

In order to compare these tools, we have created a configurable OSH model of a motorized optical filter stage. The filter stage has four components that have been modeled with both OpenSCAD and FreeCAD Python. Modeling these parts with both tools has allowed us to analyze their strengths and weakness.

As a result of our analysis we suggest that although FreeCAD Python has a larger learning curve, it has an extensive set of features that makes it more suitable and powerful for modeling open source labware.

This paper is organized as follows. In the next section, script-based FOSS CAD tools are reviewed. Next, the CAD models used as a test-bench are presented. Afterwards, the parametrization of the CAD models is described. The following section discusses the benefits and drawbacks of the two CAD tools analyzed: OpenSCAD and FreeCAD Python. Conclusions are drawn in the final section.

Script-based CAD tools for parametric modeling {#sec002}
==============================================

In this study we analyze CAD tools for open source scientific equipment. Computer software for solid modeling can be broadly classified into two types: parametric and free form mesh modelers. The former create exact and complex mathematical data structures and models. The latter generate a simple mesh of polygonal surfaces, also known as tessellated geometries. Having the purpose of designing mechanical pieces, whose dimensions must be accurate, parametric modelers are better fitted for the task. In addition to using a parametric modeler, parametric modeling is also recommended for OSH labware \[[@pone.0225795.ref007]\]. In parametric modeling, designers define the size, shape and position of geometric features and assembly components in term of parameters \[[@pone.0225795.ref035]\] \[[@pone.0225795.ref036]\] \[[@pone.0225795.ref037]\] \[[@pone.0225795.ref038]\]. Since scripting is particularly appropriate for parametric design \[[@pone.0225795.ref031]\] \[[@pone.0225795.ref039]\] \[[@pone.0225795.ref040]\], we have limited the analysis to CAD tools with scripting capabilities. Finally, following the best practices for OSH \[[@pone.0225795.ref004]\] \[[@pone.0225795.ref007]\] \[[@pone.0225795.ref011]\] \[[@pone.0225795.ref012]\] we have only selected free and open source software.

We had initially chosen OpenSCAD for being the most widely CAD tool used in parametric modeling for open source scientific equipment. However, we needed to find an alternative because OpenSCAD is not able to export to a standard parametric CAD file format such as STEP \[[@pone.0225795.ref030]\].

There are other available FOSS CAD tools for solid modeling using a programming language. Examples of these tools are BRL-CAD \[[@pone.0225795.ref041]\], CadQuery \[[@pone.0225795.ref042]\], PythonOCC \[[@pone.0225795.ref043]\], FreeCAD \[[@pone.0225795.ref033]\], ImplicitCad \[[@pone.0225795.ref044]\], OpenJSCAD \[[@pone.0225795.ref045]\] and Blender \[[@pone.0225795.ref046]\].

Blender was rejected for being a free form mesh modeler, which is more suitable to create natural or artistic designs rather than precise mechanical designs.

Both OpenJSCAD and ImplicitCad are similar to OpenSCAD. OpenJSCAD uses JavaScript as a programming language. ImplicitCad is an entirely separate project from OpenSCAD, but it has an OpenSCAD language interpreter. Thus, OpenSCAD designs can be imported to ImplicitCad. However, neither OpenJSCAD nor ImplicitCad are able to export to standard parametric file formats. Therefore, they have not been considered in the analysis as they do not provide a solution for the main OpenSCAD disadvantage.

FreeCAD is a very active project that is able to export to standard parametric CAD formats. Besides, it allows both GUI modeling and script-based modeling using Python. FreeCAD can be totally controlled by Python scripts and provides an Application Programming Interface (API) for solid modeling using Python scripts. Therefore, FreeCAD can be used by both graphical designers and CAD programmers.

PythonOCC is a Python library that provides 3D modeling features. PythonOCC is a wrapper of the OCCT library \[[@pone.0225795.ref047]\], which is the same geometric modeling kernel that FreeCAD uses. PythonOCC is able to export to standard parametric formats; nonetheless, as a Python library without graphical interface, it may be too challenging for designers with less programming experience.

BRL-CAD is a powerful solid modeler that has been active for more than 30 years; however, it is an expert oriented tool with a long learning curve. Since the OSH labware designer is not necessarily an expert CAD designer, we consider that an easier tool would be preferable.

CadQuery is a Python library that allows creating parametric models with a reduced amount of code. CadQuery has two working versions: v1.2 \[[@pone.0225795.ref042]\] and v2.0 \[[@pone.0225795.ref048]\]. The former is built on top of FreeCAD API and can be installed as a FreeCAD workbench. The latter is built on PythonOCC. Both versions are able to export to standard parametric formats.

CadQuery v1.2 can be easily integrated into FreeCAD and be used with FreeCAD graphical interface. Thus, CadQuery v1.2 will be included in the analysis as a part of FreeCAD. On the other hand, CadQuery v2.0 is a new fork of CadQuery that is independent from FreeCAD. We have not included it in our analysis because it has been recently released (December 2018) and it is in an early development stage; however, we consider that it could be a promising alternative. At the present day the two versions remain compatible; hence, the CadQuery filter stage model and the code snippets shown in this paper are valid for both versions.

[Table 1](#pone.0225795.t001){ref-type="table"} shows a summary of the FOSS CAD tools with scripting capabilities. For each tool, the central column shows if it is able to export to the STEP standard parametric format. In addition, the last column shows an important characteristic of the tool.

10.1371/journal.pone.0225795.t001

###### FOSS CAD tools with scripting capabilities.

![](pone.0225795.t001){#pone.0225795.t001g}

  CAD tool        STEP export   Main characteristic
  --------------- ------------- ----------------------------------------
  OpenSCAD        No            Widely used for parametric OSH labware
  Blender         No            Not intended for mechanical CAD
  OpenJSCAD       No            JavaScript, similar to OpenSCAD
  ImplictiCad     No            Similar to OpenSCAD
  FreeCAD         Yes           Both GUI and scripted modeling
  PythonOCC       Yes           Just for scripting, no GUI
  BRL-CAD         Yes           Expert oriented
  CadQuery v1.2   Yes           FreeCAD workbench
  CadQuery v2.0   Yes           Recently released, built on PythonOCC

Positive features for designing OSH labware are shaded in light blue. Negative features are shaded in light red. Non shaded cell describe neutral features or that could be considered positive or negative.

As it has been said, OpenSCAD is the prevalent CAD tool for OSH scientific equipment; however, OpenSCAD has a major drawback related to exporting to standard exchange formats. In order to find an alternative CAD tool, this article compares OpenSCAD with FreeCAD Python. In this analysis, we will also include CadQuery v1.2 as a part of FreeCAD workbenches.

Open hardware models created as test-bench {#sec003}
==========================================

In order to compare the proposed CAD scripting tools, we have designed a parametric OSH motorized optical filter stage. The stage allows positioning an optical filter along a linear axis. The stage has four printable pieces modeled in both OpenSCAD and FreeCAD Python. They have also been modeled using CadQuery library v1.2, which is installed as a workbench in FreeCAD. The source code of the models is available in two software repositories: one for the OpenSCAD models \[[@pone.0225795.ref049]\] and the other for the FreeCAD and CadQuery models \[[@pone.0225795.ref050]\].

These pieces are: a stepper motor bracket; an optical filter holder that can be attached to a linear guide; and two pieces that are parts of a timing belt tensioner. The models are configurable; hence, they can be easily modified by just changing the model parameters. [Fig 1](#pone.0225795.g001){ref-type="fig"} shows an arrangement example of the configurable filter stage with its printable parts highlighted.

![Arrangement example of the configurable filter stage.\
Printable parts are highlighted with colors: motor bracket (green), filter holder (yellow), belt tensioner (blue and orange).](pone.0225795.g001){#pone.0225795.g001}

Following, the printable pieces used for the analysis will be explained with more detail. For more information about the designs, the software repositories contain step-by-step tutorials explaining the generation of the models \[[@pone.0225795.ref049]\] \[[@pone.0225795.ref050]\].

Motor bracket {#sec004}
-------------

The purpose of this piece is mounting the stepper motor to a structure. It has four holes aligned to the mounting holes of the motor, and it has two slots to provide flexibility in securing the bracket to a surface. Besides, the bracket is reinforced along the sides to be able to hold heavy motors ([Fig 2A](#pone.0225795.g002){ref-type="fig"}). [Fig 2B](#pone.0225795.g002){ref-type="fig"} illustrates how the motor is mounted on an aluminum profile.

![Motor bracket.\
(A) Drawing of the motor bracket. (B) Side view of the motor mount. The bracket and the stepper motor are partially transparent to show the internal parts.](pone.0225795.g002){#pone.0225795.g002}

Filter holder {#sec005}
-------------

The filter holder is a single printable piece to place an optical filter. It has various holes to attach the piece to a linear guide. It has more bolt holes than needed to provide flexibility to use it with different linear guides or other structures. The piece has two timing belt clamps to pull the filter along the desired direction ([Fig 3A](#pone.0225795.g003){ref-type="fig"}). [Fig 3B](#pone.0225795.g003){ref-type="fig"} shows the exploded view of the filter holder mounted on a linear guide.

![Filter holder.\
(A) Drawing showing the filter holder parts. (B) Exploded view of the filter holder assembly to a linear guide.](pone.0225795.g003){#pone.0225795.g003}

Belt tensioner {#sec006}
--------------

The belt tensioner is a more complex unit because it is composed by two printable parts and some other elements such as an idler pulley, and a few bolts, nuts and washers. The printable parts are an idler pulley tensioner and a tensioner holder. [Fig 4](#pone.0225795.g004){ref-type="fig"} shows the belt tensioner with its parts from two different perspectives. The tensioner holder (blue) and the idler tensioner (orange) are the printable parts.

![Belt tensioner.\
(A) Belt tensioner side-front view. (B) Belt tensioner side-back view.](pone.0225795.g004){#pone.0225795.g004}

To help understanding of the belt tensioner assembly, [Fig 5](#pone.0225795.g005){ref-type="fig"} shows an exploded view of its parts.

![Exploded view of the belt tensioner.\
The two printable parts are drawn in colors: tensioner holder (blue) and idler tensioner (orange).](pone.0225795.g005){#pone.0225795.g005}

The belt tensioner works by turning the leadscrew. The leadscrew nut cannot rotate because it is inserted inside the idler tensioner; thus, depending on the direction of the leadscrew rotation, the belt tensioner will retract ([Fig 6A](#pone.0225795.g006){ref-type="fig"}) or extend ([Fig 6B](#pone.0225795.g006){ref-type="fig"}) the idler tensioner (orange). As a consequence, this operation tightens or loosens the timing belt.

![Belt tensioner operation.\
The leadscrew tightens or loosens the idler tensioner (orange). (A) Side view of the retracted belt tensioner. (B) Side view of the extended belt tensioner.](pone.0225795.g006){#pone.0225795.g006}

3D printing the models {#sec007}
----------------------

These four pieces have been designed to be 3D printed without support structures. Printing without support is faster, minimizes waste material, produces better surface finishing, reduces post processing work and thus, decreases the probability of damaging the piece due to the post processing.

[Fig 7](#pone.0225795.g007){ref-type="fig"} shows the orientation to print the pieces without support structures.

![3D printing orientation of the four printable models to avoid supports.](pone.0225795.g007){#pone.0225795.g007}

Parametric design {#sec008}
=================

One of the main advantage of script-based modeling is the ability to change parameters values and generate variations of the original model with little effort. Programmed modeling can be time consuming compared to traditional graphical design, but the effort pays off when many variations of the model are needed, or when not all the specifications have been set from the beginning; thus, the final dimensions may change.

We have defined several parameters for the proposed models. Following, the main parameters for the motor bracket, the filter holder and the belt tensioner will be described.

Motor bracket parameters {#sec009}
------------------------

Depending on the stepper motor size the resulting bracket will have different dimensions; hence, the main parameter is the standardized NEMA size of the motor. For example, the NEMA size will define the parameter `motorbolt_sep` shown in [Fig 8](#pone.0225795.g008){ref-type="fig"} and will also determine the minimum inner space for the motor. Other parameters such as walls thickness, the length and width of the slots can be modified. Some of the main parameters are shown in [Fig 8](#pone.0225795.g008){ref-type="fig"}.

![Motor bracket main parameters.](pone.0225795.g008){#pone.0225795.g008}

As an example, [Fig 9](#pone.0225795.g009){ref-type="fig"} shows the resulting brackets for two different motor sizes. Note that the length of the slots have also been modified.

![Two brackets for different stepper motor sizes.](pone.0225795.g009){#pone.0225795.g009}

Filter holder parameters {#sec010}
------------------------

The filter holder can be configured to carry different filter sizes and to be attached to almost any bolt arrangement. For this purpose, the bolt hole positions and sizes are configurable. [Fig 10](#pone.0225795.g010){ref-type="fig"} shows the main filter holder parameters. There are other parameters that are less critical and are documented in the source code.

![Main filter holder parameters.](pone.0225795.g010){#pone.0225795.g010}

As an example, [Fig 11](#pone.0225795.g011){ref-type="fig"} shows two filter holders that have been generated with different parameters.

![Two filter holders for different filter sizes and linear guides.](pone.0225795.g011){#pone.0225795.g011}

Belt tensioner parameters {#sec011}
-------------------------

Unlike the motor bracket and the filter holder, the belt tensioner is composed by various elements; consequently, some of the dimensions of these elements are interdependent. In these cases, parametric design plays a significant role because it allows to establish the dependencies among the components. Thus, relieving the user from considering these relationships because they are automatically taken into account by the parametric model.

Basically, the tensioner holder depends on the idler tensioner dimensions, and the idler tensioner depends on the idler pulley dimensions. In particular, the parameters that determine the dimensions of the idler tensioner are:

-   Idler pulley size.

-   Tensioner stroke.

-   Thickness of the walls.

-   Leadscrew metric.

The parameters that determine the dimensions of the tensioner holder are:

-   Idler tensioner size (determined by the aforementioned parameters).

-   Belt height.

-   Profile size where it is going to be mounted and its bolts size.

-   Thickness of the walls.

Following, these parameters are explained in detail.

### Idler pulley {#sec012}

Some of the dimensions of the printable pieces depend on the idler pulley size. Idler pulleys can be easily acquired; but also, they can be made using bearings and washers, or they can be 3D printed. [Fig 12](#pone.0225795.g012){ref-type="fig"} shows an example of an idler pulley made of a specific bearing and some washers.

![Example of an idler pulley made out of a bearing and some washers.](pone.0225795.g012){#pone.0225795.g012}

The idler pulley can be made with different component sizes. For example, [Fig 13](#pone.0225795.g013){ref-type="fig"} shows two possible configurations and their influence on the idler tensioner size. The figure shows that the width of the idler tensioner is determined by the pulley size. Also, the space for the pulley will vary depending on the pulley size.

![Comparing two idler tensioners made out of different components.\
The size of the idler tensioner is smaller when it contains an idler pulley using a M3 bolt (A), than when using a M4 bolt (B). For example, the space for the pulley or the tensioner width are smaller for case A than case B, as the figure shows that `sep_m3 < sep_m4` and `tens_w_m3 < tens_w_m4`.](pone.0225795.g013){#pone.0225795.g013}

### Tensioner stroke {#sec013}

The tensioner stroke defines the length of the tensioner; that is to say, how much it can be extended or retracted. [Fig 14](#pone.0225795.g014){ref-type="fig"} shows three different tensioner stroke values and their influence on the tensioner length.

![Idler tensioners with different stroke lengths.](pone.0225795.g014){#pone.0225795.g014}

### Wall thickness {#sec014}

The thickness of the walls has an effect on the overall height of the tensioner ([Fig 15](#pone.0225795.g015){ref-type="fig"}). The wall thickness has also a small influence on the length.

![Idler tensioners with different wall thickness.](pone.0225795.g015){#pone.0225795.g015}

### Leadscrew diameter {#sec015}

Depending on the leadscrew diameter, a different size for the nut hole will be needed. This will have a small effect on the idler tensioner length ([Fig 16](#pone.0225795.g016){ref-type="fig"}). Obviously, the diameter of the leadscrew hole will also change.

![Idler tensioners with different leadscrew diameters.](pone.0225795.g016){#pone.0225795.g016}

### Idler tensioner size {#sec016}

All the previous parameters determine the idler tensioner dimensions. Since the idler tensioner is coupled inside the tensioner holder, the idler tensioner size impacts on the size and shape of the tensioner holder. [Fig 17](#pone.0225795.g017){ref-type="fig"} shows two idler tensioners having different parametric values. The corresponding tensioner holders also result in different shapes and sizes. Note how the wall thickness is the same parameter for both the holder and the tensioner.

![Tensioner holder dimensions depending on idler tensioner sizes.](pone.0225795.g017){#pone.0225795.g017}

### Belt height {#sec017}

This parameter sets the position of the bottom of the belt along the height of the tensioner ([Fig 18A](#pone.0225795.g018){ref-type="fig"}). Changes in this parameter will generate taller or shorter tensioner holders as shown in [Fig 18B](#pone.0225795.g018){ref-type="fig"}.

![Belt height parameter.\
(A) Definition of the belt height. (B) Belt tensioners with different belt heights.](pone.0225795.g018){#pone.0225795.g018}

### Base width {#sec018}

The base width or profile size indicates the profile size where the belt tensioner will be mounted. [Fig 19](#pone.0225795.g019){ref-type="fig"} shows the resulting belt tensioners for three different profile sizes.

![Belt tensioners with different base width.](pone.0225795.g019){#pone.0225795.g019}

### Other parameters {#sec019}

There are other parameters but they do not have a considerable influence over the size. Examples of such parameters are the radius of the fillets or the size of the profile bolts. They are documented in the source code \[[@pone.0225795.ref049]\] \[[@pone.0225795.ref050]\].

Discussion {#sec020}
==========

In this section we compare OpenSCAD and FreeCAD Python. The analysis will include CadQuery v1.2 as a part of FreeCAD since, as stated above, CadQuery v1.2 can be added as an external FreeCAD workbench. Throughout this section, we will use the terms CadQuery workbench or just CadQuery to refer to CadQuery v1.2.

We have organized the discussion in four main topics: the geometric modeling kernel, the usability, the programming language characteristics and the tool features.

Geometric modeling kernel {#sec021}
-------------------------

Both OpenSCAD and FreeCAD use an external library as a geometric modeling kernel.

OpenSCAD uses the CGAL constructive solid geometry library \[[@pone.0225795.ref051]\]. In constructive solid geometry (CSG) solid models are created by applying successive operations to a set of basic shapes. These shapes are called primitives and the operations can be rigid motions (such as translation and rotation) or boolean operations (union, intersection and difference) \[[@pone.0225795.ref052]\] \[[@pone.0225795.ref053]\].

FreeCAD uses the Open Cascade Technology (OCCT) libraries \[[@pone.0225795.ref047]\]. OCCT is based on boundary representation (B-rep), in which objects are represented by their topological boundaries. A solid model is defined by a set of surface elements that delimit the boundary between the interior and the exterior of the solid. The surface elements are often defined by parametric equations \[[@pone.0225795.ref052]\] \[[@pone.0225795.ref053]\].

CadQuery v1.2 is a Python library built on top of FreeCAD API; consequently, it ultimately also uses the OCCT kernel.

One of the most serious disadvantages of OpenSCAD is the use of CGAL because CGAL works with polygonal meshes rather than parametric models. On the other hand, this problem is not present in FreeCAD because OCCT is a parametric modeler.

Easy of use {#sec022}
-----------

The usability has been divided into two subsections: how difficult is to step up the tool to just start coding and how easy is to model with the given language.

### Tool setup {#sec023}

OpenSCAD is extraordinarily easy to set up. OpenSCAD has an editor window where any code can be tested; thus, it is a matter of start coding and then, clicking a button to save, preview, render or generate the resulting STL file of the model. The code can be saved in a text file with an \*.scad extension.

Moreover, OpenSCAD has some model examples that can be loaded from the menu. This is a simple but a very useful characteristic to test the tool capabilities and learn by example.

OpenSCAD allows to have file dependencies in order to keep commonly used functions or constants in a different file. To define the location of these files, the relative path has to be included in the appropriate command.

On the other hand, using Python scripts in FreeCAD is not that simple. Actually, the tutorial about using Python in FreeCAD is placed in a section called "Power users hub" \[[@pone.0225795.ref054]\], what suggest that FreeCAD is not intended to be used in this way by the novice.

Since modeling in FreeCAD is primarily conceived to be done graphically instead of programmed, there is no code editor window when starting FreeCAD as in OpenSCAD. Instead, we have found two options.

The first option is the Macro Editor, where Python scripts can be executed and saved in the *User macro* directory.

The second option is the Python Console, where any command can be executed; however, it is a console, not a file editor where the user can save their design in a text file, as it is in OpenSCAD. From this console, any Python file can be loaded, but it is not straightforward. Similarly, loading other files dependencies is not direct unless the files are kept inside some specific directories.

The associated FreeCAD Python software repository of the OSH filter stage design \[[@pone.0225795.ref050]\] includes further information about how to execute the scripts.

Alternatively, the CadQuery workbench can be easily installed in FreeCAD through the Addon Manager, which is available from the graphical user interface. This workbench includes an editor window that allows editing and executing Python code. Furthermore, this workbench has several CadQuery example designs that can be loaded to learn by example.

CadQuery workbench and its editor can be used to design using both CadQuery and FreeCAD APIs. Therefore, it is a good place to start modeling with FreeCAD Python scripts in any of these two options available. Nonetheless, we find that the error messages given through the CadQuery workbench are more obscure than those given through FreeCAD Python console. Thus, we find debugging with CadQuery more difficult than using the FreeCAD console.

### Modeling {#sec024}

OpenSCAD language is similar to C programming language. OpenSCAD has a few basic 2D and 3D primitives (such as circle, square, polygon, cube, sphere, polyhedron and cylinder) and some operations and transformations. With these basic primitives and operations almost any technical piece can be modeled. Nevertheless, there are some operations that we missed, such as filleting or chamfering.

Since OpenSCAD has a limited set of primitives and functions, it is relatively easy to learn. There are good step-by-step tutorials that provide all the information to become skillful within a short time \[[@pone.0225795.ref021]\] \[[@pone.0225795.ref055]\].

As an example, [Fig 20A](#pone.0225795.g020){ref-type="fig"} shows the OpenSCAD code to model a box (rectangular cuboid).

![Sample codes to model a rectangular cuboid.\
Code (A) is modeled in OpenSCAD. Codes (B) and (C) are modeled using FreeCAD Python scripts. Code (D) is modeled using a Python script for FreeCAD CadQuery workbench.](pone.0225795.g020){#pone.0225795.g020}

FreeCAD uses Python; thus, there is no need to learn a new programming language for those who already know it. FreeCAD offers a Python Application Programming Interface (API) to its OCCT kernel \[[@pone.0225795.ref047]\]. This API allows creating and accessing OCCT geometric primitives and functions. Essentially, there are two different kind of objects in FreeCAD Python: OCCT shapes and FreeCAD objects. OCCT shapes are the underlying OCCT solid models. On the other hand, FreeCAD objects link the OCCT shapes to their graphical representation. Therefore, in order to display an OCCT shape in FreeCAD graphical interface, there should be a FreeCAD object associated to that OCCT shape.

[Fig 20B](#pone.0225795.g020){ref-type="fig"} shows a FreeCAD Python script where these two objects are created. The OCCT shape (`sbox`) is created in line 5. The FreeCAD object is created in line 6; thus, drawing the OCCT shape in the graphical interface. In addition to these objects, the code include lines 2 and 3 to import libraries, and line 4 to create a FreeCAD document to be able to save it. Once the FreeCAD document is saved, not only the source code can be shared but also the FreeCAD model, allowing it to be modified through the FreeCAD graphical interface.

Alternatively, FreeCAD API offers functions that automatically create FreeCAD objects with its underlying OCCT shape. These functions hide the OCCT shape from the user. [Fig 20C](#pone.0225795.g020){ref-type="fig"} shows an example where a FreeCAD object (`fbox`) is created in line 4. This FreeCAD object already links to its OCCT shape, which can be accessed through an attribute. Lines 6 to 8 are used to assign the box dimensional values.

Although there are some tutorials about FreeCAD Python scripting \[[@pone.0225795.ref054]\], they are not comprehensive and the documentation is neither complete nor well organized. However, since FreeCAD GUI commands are just Python scripts, and these scripts can be redirected to FreeCAD Python console, an alternative way to learn is to create models with FreeCAD GUI commands and observe their corresponding Python scripts in the console.

CadQuery v1.2 is a Python library on top of the FreeCAD API. CadQuery eases parametric feature-based modeling by providing methods to facilitate the location and creation of features. Nevertheless, although the design approach is intuitive for simple or symmetrical models, we have found that it may be confusing for intricate pieces. CadQuery has well organized documentation and tutorials, what improves the learning process \[[@pone.0225795.ref056]\].

CadQuery creates its own type of objects for solid modeling. Since CadQuery is a library on top of the FreeCAD API, CadQuery objects also link to the underlying OCCT shapes. In addition, if we want to represent the shapes in the FreeCAD GUI, a FreeCAD object has also to be created.

[Fig 20D](#pone.0225795.g020){ref-type="fig"} shows an example of a CadQuery script. A CadQuery object is created in line 4. This object includes the underlying OCCT shape. Line 5 creates the FreeCAD object that draws the shape in FreeCAD GUI, although the user may not realize that a FreeCAD object has been created. Line 4 of [Fig 20D](#pone.0225795.g020){ref-type="fig"} exposes a differentiated CadQuery characteristic: CadQuery builds the geometry from defined planes (`Workplane`).

As a summary, [Fig 20](#pone.0225795.g020){ref-type="fig"} shows different codes to model a rectangular cuboid. The three FreeCAD Python examples (B, C, D) contrast with OpenSCAD simplicity (A) and illustrate the initial difficult that the newcomer may face using FreeCAD scripts. He will not only need to learn how to describe a model using a programming language, but also he would have to understand the intricacies of the different objects, methods, libraries and the underlying OCCT kernel. It may not be a problem if the designer has a programming background, but if the designer has little experience in programming, the initial barrier could be high.

Programming language characteristics {#sec025}
------------------------------------

In this subsection, some of the most significant programming language characteristics of both tools are compared. The analysis includes the programming paradigm, the scope of variables, the data types and the libraries.

### Programming paradigm {#sec026}

Programming languages can be classified based on their features. OpenSCAD is a declarative, purely functional language \[[@pone.0225795.ref055]\]; whereas Python supports multiple programming paradigms, including procedural, object-oriented, and functional programming \[[@pone.0225795.ref034]\].

As a consequence of OpenSCAD functional programming paradigm, variables are set at compile time, not at run time. Therefore, variables keep a constant value during their entire lifetime. If a variable is assigned a value multiple times, only the last value is used in all places of the code. This characteristic can be confusing for programmers used to procedural languages such as C or Python. For example, in [Fig 21A](#pone.0225795.g021){ref-type="fig"} variable `x` will have a constant value of 10; consequently, this script will create two spheres of the same radius 10. The assignment in line 1 has no effect and may mislead the designer in thinking that the spheres will have different size. The sphere created in line 2 will have a radius of 10 even that the final assignment of variable `x` is made afterwards (line 3).

![OpenSCAD sample codes to show the effect of its functional programming paradigm.\
(A) Assignment in line 1 has no effect since variables keep a constant value during their entire lifetime. (B) The code shows an invalid assignment since variables cannot change their values.](pone.0225795.g021){#pone.0225795.g021}

For this same reason, the assignment `x = x + 1` is not valid in OpenSCAD ([Fig 21B](#pone.0225795.g021){ref-type="fig"}).

On the other hand, Python is a multi-paradigm language and variables can be modified at running time as in procedural languages. Furthermore, it can make use of other paradigms such as object oriented programming, which is extensively adopted in FreeCAD Python.

Functional languages have benefits such as being more predictable and less prone to bugs; however, the programmer used to procedural paradigms may find functional programming too rigid to make fully parametric designs.

### Scope of variables {#sec027}

Variables are created within a scope in OpenSCAD; thus, their values are not available outside that scope. [Fig 22A](#pone.0225795.g022){ref-type="fig"} shows a situation where the variable scope may produce a different behavior than expected. Since `y` is assigned both outside and inside the if statement, `y` will have two different values depending on the scope. As a consequence, the sphere in line 7 will not be affected by the assignment of `y` inside the if statement (line 4); thus, producing spheres of different size.

![Sample codes to show the variable scope in OpenSCAD.\
(A) Assignment in line 4 has no effect outside the if statement; therefore the sphere in line 7 will have a radius of 1. (B) This code produces the same result as in (A) even that the variable assignments are placed after the sphere function calls that use those variables.](pone.0225795.g022){#pone.0225795.g022}

Note how scripts in [Fig 22A and 22B](#pone.0225795.g022){ref-type="fig"} are equivalent. The differences lie in the assignments placement, but since OpenSCAD is a functional language, both descriptions generate the same model.

OpenSCAD scoping rules can make parametric models more complicated to design when establishing variable dependencies. For example, suppose we want to create a cylinder whose height depends on its radius value. If the radius is 5, the height will be 15; otherwise, the height will be 20. [Fig 23](#pone.0225795.g023){ref-type="fig"} shows shows three attempts to do this.

![Parametric design and variable scope in OpenSCAD.\
Code (A) will not work because `h` has not been defined outside the if statement. Codes (B) and (C) will work.](pone.0225795.g023){#pone.0225795.g023}

The first attempt ([Fig 23A](#pone.0225795.g023){ref-type="fig"}) will not work because `h` has not been assigned outside the if statement; therefore, it will be undefined when calling the cylinder function.

The second script ([Fig 23B](#pone.0225795.g023){ref-type="fig"}) has solved the problem by creating the cylinder inside the if alternatives. Nevertheless, this solution lacks efficiency because the same function call has to be repeated. For this small example we had to repeat the cylinder function call in lines 4 and 7.

The third example ([Fig 23C](#pone.0225795.g023){ref-type="fig"}) uses the conditional `?` to avoid assigning `h` in an inner scope. Although we can resort to the conditional `?` to create variables in an outer scope, it can be cumbersome to use it when there are many alternatives or when there are more than one variable to assign. We have experienced this problem when defining the dependencies of the belt tensioner, as it can be seen in OpenSCAD file `kidler.scad` \[[@pone.0225795.ref049]\]. Nonetheless, it can be used efficiently in combination with vectors, as some libraries of technical components have done \[[@pone.0225795.ref057]\] \[[@pone.0225795.ref058]\] \[[@pone.0225795.ref059]\].

Python does not have this behavior. Variables can be updated anywhere in the code, and they keep their value within their scope. Unlike OpenSCAD, the programmer can define the scope of variables using local, global and nonlocal variables.

### Data types {#sec028}

OpenSCAD has a limited set of data types: number (64 bit floating point), boolean, string, range, vectors and undefined. There are not user defined types in OpenSCAD.

In contrast, Python has several data types. Python provides the standard built-in data types, but also other specialized data types defined in the Python standard library and other available modules. In addition, programmers can create their own data types.

The standard data types can be summarized in numbers (integer, floating point and complex), strings, lists, tuples, sets and dictionaries. Some of them can be very useful for managing information, like lists and dictionaries. We have extensively used them to define the dimensions of the components of our OSH test-bench.

For example, [Fig 24A](#pone.0225795.g024){ref-type="fig"} shows how a dictionary can be used to get the thickness of a DIN 125 washer. In [Fig 24B](#pone.0225795.g024){ref-type="fig"} a two-dimensional dictionary is used.

![Sample codes of dictionaries for defining component dimensions in Python.\
(A) Dictionary DIN125_H defines the height (thickness) of some DIN 125 washers. Keys can be a float number, as in line 2. Line 6 shows how to obtain the height (0.5) of a DIN125 M2.5 washer from the dictionary. (B) Dictionaries can be multidimensional and can have strings as keys.](pone.0225795.g024){#pone.0225795.g024}

It is possible to have relatively analogous structures in OpenSCAD to get same result. Like using the conditional `?` with vectors (similar to [Fig 23C](#pone.0225795.g023){ref-type="fig"}). However, Python data types allow much more flexibility; moreover, Python offers a set of optimized methods and functions to manipulate these data structures efficiently.

### Libraries {#sec029}

OpenSCAD has a limited set of functions; however, anyone can create libraries to facilitate the design process. OpenSCAD has some libraries available ranging from mathematical functions to the creation of useful shapes and mechanical parts \[[@pone.0225795.ref057]\] \[[@pone.0225795.ref058]\] \[[@pone.0225795.ref059]\] \[[@pone.0225795.ref060]\].

FreeCAD has libraries of components \[[@pone.0225795.ref057]\] \[[@pone.0225795.ref061]\] and also has modules to extend FreeCAD functionality, such as CadQuery \[[@pone.0225795.ref042]\]. These modules provide a wide set of tools varying from advanced modeling to the creation of all kind of mechanical objects. The modules are available through the graphical interface as workbenches \[[@pone.0225795.ref062]\] \[[@pone.0225795.ref063]\].

In addition to these specific FreeCAD extensions, the FreeCAD Python programmer can resort to the rich and versatile Python standard library and other specialized modules. Python libraries are developed by a vast community, much larger than the FreeCAD or OpenSCAD specific communities. This is of paramount importance because it provides innumerable standardized solutions to FreeCAD Python.

As an example, file manipulation in FreeCAD Python is made through Python libraries, not because FreeCAD developers implemented that functionality. Consequently, if a FreeCAD Python designer wants to include the ability to read data from a file, she would just need to use the appropriate Python library to read and parse that file. In contrast, adding the ability to read and manipulate files in OpenSCAD would require OpenSCAD developers to implement that functionality.

This characteristic allows Python programmers to count on libraries for innumerable tasks. Examples of this kind of tasks are reading text files to get parameter values; writing text files to generate reports or bill of materials; performing many kind of computations, such as mathematical, matrix and finite elements; error handling; working with data interchange formats, like JSON, XML, YAML; among many other tasks. As a result, Python libraries add a broad range of capabilities to FreeCAD Python.

Tool features {#sec030}
-------------

Both OpenSCAD and FreeCAD are multiplatform (Windows, MacOS and Linux) free and open source software. OpenSCAD is under GPL2 and FreeCAD under LGPL2+.

This subsection analyzes two important features: the graphical interface and the import/export capabilities. In addition, we explore some characteristics like the performance and the suitability for modeling complete systems. To end, we look into the status of the software project development.

### Graphical user interface (GUI) {#sec031}

OpenSCAD GUI has commands for visualization such as zoom, rotation, change of perspective, among a few other commands. There is the option to include axis and perform animations. OpenSCAD also allows changing the color and transparency of the objects, although it cannot be done through the GUI, but must be defined in the code. OpenSCAD also features a parameter customizer that allows changing the model parameters from the GUI.

On the other hand, since FreeCAD has been mainly devised to be used through its GUI, it has all kind of commands to visualize, measure and transform the models. Commands are organized in workbenches to perform related tasks. As an example, it has the Technical Draw Workbench, which produces basic technical drawings of the models similar to Figs [8](#pone.0225795.g008){ref-type="fig"} and [10](#pone.0225795.g010){ref-type="fig"}.

Another remarkable feature of FreeCAD is its ability to integrate the scripts as commands in the graphical interface, allowing designers to generate and customize the models through the GUI. Therefore, regular users would not need to work with the source code. As a conclusion, FreeCAD GUI is clearly more powerful and flexible than OpenSCAD.

### Import/Export capabilities {#sec032}

As we have said, OpenSCAD has limited export/import capabilities. OpenSCAD can import some 2D file formats but only imports 3D tessellated file formats such as STL. The problem with these file formats is that they no longer contain parametric information.

This is an important limitation when working in projects with different CAD tool users. The OpenSCAD designer cannot incorporate exact models from other CAD tools in her/his design.

Likewise, OpenSCAD can only export to tessellated 3D file formats. These formats are suitable for 3D printing, but not to get an exact representation of the model. From our point of view, this is one of the main OpenSCAD drawbacks, since it inhibits sharing exact dimensional models. It seems that OpenSCAD is more oriented to the creation of models for 3D printing, but not to create exact dimensional models of the pieces that can be used in other CAD tools.

Actually, as it has been said, the question is that OpenSCAD uses a kernel that works with polygonal meshes rather than parametric models. Therefore, despite that the design have been modeled parametrically in OpenSCAD, the parametric information is lost once the internal model is generated.

[Fig 25](#pone.0225795.g025){ref-type="fig"} visually explains this situation with an example. On the left we have the source codes for OpenSCAD ([Fig 25A](#pone.0225795.g025){ref-type="fig"}) and FreeCAD ([Fig 25B](#pone.0225795.g025){ref-type="fig"}). OpenSCAD can only generate 3D tessellated models, which can be exported to mesh file format such as a STL. As it can be observed, the tessellated model is made of a polygonal mesh, what implies that the parametric dimensions, such as the radius of the primitives (sphere, cone and cylinder), have been lost.

![Source codes and their generated models.\
(A) OpenSCAD can export to polygonal mesh models, but not export to parametric models. (B) FreeCAD can export to both polygonal mesh models and standard parametric models.](pone.0225795.g025){#pone.0225795.g025}

On the other hand, FreeCAD generates a parametric model that can be exported to a standard parametric file format such as STEP. This file format preserves its original dimensional information and can be manipulated by most of CAD tools; that is to say, it can be used as a source for future modifications in other CAD tools. This is an important feature, since other potential users may not be interested in coding, or they use a CAD tool that cannot import the source code. In addition, FreeCAD can also generate the tessellated model used for production.

In addition to FreeCAD ability to import/export to standard parametric models, FreeCAD has a workbench to offer interoperability with OpenSCAD. This workbench contains functions to import and repair OpenSCAD models. Nevertheless, depending on the OpenSCAD primitives used, some of the parametric information may be lost.

### Speed {#sec033}

We have attempted to compare the time taken to generate the models in both tools. However, since OpenSCAD creates a tessellated model, the speed depends on the mesh resolution. The resolution can be defined by OpenSCAD special variables `$fa`, `$fs` and `$fn`. Variable `$fa` defines the minimum angle for a fragment, `$fs` defines the minimum size of a fragment.

On the other hand, there is no need to specify the mesh resolution in FreeCAD unless a tessellated model is needed. [Table 2](#pone.0225795.t002){ref-type="table"} shows the time in seconds that took FreeCAD to generate the parametric models. FreeCAD CadQuery models take a similar time than plain FreeCAD Python because they use the same FreeCAD API. Actually, some of CadQuery models used in this study took slightly less time because, in order to make the tutorials, the FreeCAD Python models include the graphical representation of every step of the construction process. Nevertheless, since the execution times are very similar, for clarity purposes, only the execution time of the plain FreeCAD Python models will be included.

10.1371/journal.pone.0225795.t002

###### Time to generate parametric models.

![](pone.0225795.t002){#pone.0225795.t002g}

  Parametric time    OpenSCAD                                FreeCAD
  ------------------ --------------------------------------- ---------
  Motor bracket      [\*](#t002fn001){ref-type="table-fn"}   0.43 s
  Filter holder      [\*](#t002fn001){ref-type="table-fn"}   0.76 s
  Idler tensioner    [\*](#t002fn001){ref-type="table-fn"}   0.45 s
  Tensioner holder   [\*](#t002fn001){ref-type="table-fn"}   0.61 s

\* OpenSCAD does not generate parametric models.

In order to compare the speed, all the scripts have been executed in a computer with an Intel Core i7-4700Q CPU at 2.4GHz and 8 GB RAM running 64 bit Windows 10 Home. In FreeCAD Python the completion time has been measured with the function `datetime.now()` (code is available in \[[@pone.0225795.ref050]\]). In OpenSCAD the completion time has been obtained by the provided rendering report. This report does not provide fractions of seconds.

The tessellated models generated by both tools are different, as it can be appreciated in [Fig 25](#pone.0225795.g025){ref-type="fig"}. We have not found any option in OpenSCAD to generate a different kind of mesh. FreeCAD has three meshing options: standard, Mefisto and Netgen. Each option has their own parameters to adjust the resolution and sometimes the shape of the mesh. FreeCAD standard mesh seems to be the most similar to OpenSCAD mesh. FreeCAD standard mesh has two parameters to define the mesh resolution: the angular deviation (`ad`) measured in angular degrees, and the deviation of the surface (`sd`) measured in millimeters. The former limits the angle between subsequent segments in a polyline. The latter limits the distance between a curve and its tessellation \[[@pone.0225795.ref064]\]. Note that these parameters do not correspond to OpenSCAD special variables; although in both cases, the smaller the values are, the higher the resolution will be.

Starting from values that in our experience have provide a good 3D printing quality, we have increased the resolution of both meshes in order to have more data to compare. We have defined three levels of coarseness: coarse, normal and fine. [Table 3](#pone.0225795.t003){ref-type="table"} shows the chosen values for these parameters.

10.1371/journal.pone.0225795.t003

###### Selected parameter values to get different mesh resolutions.

![](pone.0225795.t003){#pone.0225795.t003g}

           OpenSCAD   FreeCAD         
  -------- ---------- --------- ----- ---------
  Coarse   6°         0.4 mm    30°   0.1 mm
  Normal   6°         0.2 mm    15°   0.05 mm
  Fine     3°         0.1 mm    3°    0.01 mm

[Table 4](#pone.0225795.t004){ref-type="table"} shows the number of elements (vertices, edges and facets) of each of the generated meshes of the motor bracket. From the table we can see that the meshes generated by OpenSCAD and FreeCAD are different, since for a similar number of vertices, FreeCAD meshes have a much larger number of edges and facets than OpenSCAD meshes.

10.1371/journal.pone.0225795.t004

###### Motor bracket: Number of vertices, edges and facets of the meshes and time to generate them.

![](pone.0225795.t004){#pone.0225795.t004g}

  Motor bracket                                           OpenSCAD   FreeCAD                             
  ------------------------------------------------------- ---------- --------- ------- -------- -------- --------
  Vertices                                                479        807       1,568   402      722      3,394
  Edges                                                   719        1,211     2,352   1,242    2.202    10,218
  Facets                                                  242        406       786     828      1,468    6,812
  **Total time** [^a^](#t004fn001){ref-type="table-fn"}   2 s        4 s       8 s     0.45 s   0.47 s   0.57 s

^a^FreeCAD time includes the generation of the parametric model ([Table 2](#pone.0225795.t002){ref-type="table"})

FreeCAD is clearly faster generating meshes, especially when the resolution is increased. OpenSCAD times rise at a much higher rate for finer resolutions. At the finest resolution FreeCAD is more than ten times faster.

FreeCAD generates the meshes from the parametric model. Therefore, once the parametric model has been generated, the parametric time ([Table 2](#pone.0225795.t002){ref-type="table"}) can be subtracted from the total time ([Table 4](#pone.0225795.t004){ref-type="table"}). Comparing the time values of these tables, it can be observed that FreeCAD only uses a fraction of the total time to generate the mesh of the motor bracket.

[Table 5](#pone.0225795.t005){ref-type="table"} shows the same information for the filter holder. The filter holder is the most complex piece. As a result, it has the largest amount of elements and it takes more time to generate the meshes. Again, it can be observed that for larger meshes FreeCAD is much faster than OpenSCAD. For the fine resolution is more than 50 times faster.

10.1371/journal.pone.0225795.t005

###### Filter holder: Number of vertices, edges and facets of the meshes and time to generate them.

![](pone.0225795.t005){#pone.0225795.t005g}

  Filter holder                                           OpenSCAD   FreeCAD                             
  ------------------------------------------------------- ---------- --------- ------- -------- -------- --------
  Vertices                                                1,972      2,746     5,422   1,178    2,282    11,114
  Edges                                                   2,958      4,119     8,133   3,600    6,912    33,408
  Facets                                                  1,000      1,387     2,725   2,400    4.608    22,272
  **Total time** [^a^](#t005fn001){ref-type="table-fn"}   30 s       45 s      102 s   0,87 s   0,90 s   1,47 s

^a^FreeCAD time includes the generation of the parametric model ([Table 2](#pone.0225795.t002){ref-type="table"})

The idler tensioner and the tensioner holder are not intricate pieces. Their complexity lies on their parameters dependencies, but once the pieces are created, the meshes are relatively simple. ([Table 6](#pone.0225795.t006){ref-type="table"}) shows their meshes size and the time to create them. The resulting data is in line with of these tables support the previous analysis.

10.1371/journal.pone.0225795.t006

###### Idler tensioner: Number of vertices, edges and facets of the meshes and time to generate them.

![](pone.0225795.t006){#pone.0225795.t006g}

  ------------------------------------------------------- ---------- --------- -------- -------- -------- --------
  Idler tensioner                                         OpenSCAD   FreeCAD                              
  Coarse                                                  Normal     Fine      Coarse   Normal   Fine     
  Vertices                                                474        830       1,610    316      580      2,694
  Edges                                                   713        1,247     2,417    972      1,764    8,106
  Facets                                                  241        419       809      646      1,174    5,400
  **Total time** [^a^](#t006fn001){ref-type="table-fn"}   4 s        7 s       13 s     0.54 s   0.54 s   0.61 s
  Tensioner holder                                        OpenSCAD   FreeCAD                              
  Coarse                                                  Normal     Fine      Coarse   Normal   Fine     
  Vertices                                                535        778       1,498    322      591      2,741
  Edges                                                   777        1,142     2,192    990      1,797    8,247
  Facets                                                  246        368       698      660      1,198    5,498
  **Total time** [^a^](#t006fn001){ref-type="table-fn"}   6 s        8 s       16 s     0.63 s   0.64 s   0.71 s
  ------------------------------------------------------- ---------- --------- -------- -------- -------- --------

^a^FreeCAD time includes the generation of the parametric model ([Table 2](#pone.0225795.t002){ref-type="table"})

[Fig 26](#pone.0225795.g026){ref-type="fig"} summarizes the total time to generate the meshes. As can be seen in the graph, the worst case in FreeCAD (filter holder fine mesh) is slightly faster than the best case in OpenSCAD (motor bracket coarse mesh). Nevertheless, given that the meshes are not equivalent and the limited number of pieces used in the study, the results should be treated with caution.

![Mesh generation times in OpenSCAD an FreeCAD.](pone.0225795.g026){#pone.0225795.g026}

### System modeling {#sec034}

A complete mechanical system can be modeled with OpenSCAD and there are some very good examples in OpenSCAD gallery \[[@pone.0225795.ref065]\]. Nevertheless, we believe that OpenSCAD is more oriented to create solid models of individual pieces with the purpose of 3D printing. We find some arguments to support this idea.

First, a system model is useful to get a visual idea, document and share the complete device. However, OpenSCAD lacks a powerful graphical interface and no model transformations can be done through it.

Secondly, OpenSCAD import/export capabilities are limited to tessellated file formats; thus, OpenSCAD models cannot be integrated in a design of a different CAD tool without losing information. Conversely, a parametric model created in other CAD tool cannot be integrated in a OpenSCAD design without information loss.

An example of the relevance of the import/export capabilities for generating a system model is the collaboration between Electronic CAD (ECAD) and Mechanical CAD (MCAD) tools to generate models that integrate electrical and mechanical components \[[@pone.0225795.ref066]\]. FreeCAD parametric models of electronic components can be exported to electronic design tools such as KiCad \[[@pone.0225795.ref067]\]. As a result, KiCAD can generate the whole CAD model of the electronic board with its components. Finally, the resulting CAD model of the board could be integrated into FreeCAD in order to create the CAD model of the whole electromechanical system. There is even a FreeCAD workbench aiming to foster the collaboration between KiCad and FreeCAD \[[@pone.0225795.ref068]\]. Although there is a way to do it in OpenSCAD, it is not direct and the parametric information is lost.

Thirdly, OpenSCAD rendering speed slows in complex models, what supports the idea that it is not a tool to generate a whole system.

In contrast, FreeCAD is conceived to model both individual pieces or a complete system. It has a powerful GUI and it is mainly developed to be used in this way, but at the same time, it has powerful programming capabilities. The generated models can be exported and imported into standard formats, so CAD files can be incorporated and shared to the public without losing information. As an example, the complete parametric OSH system presented in this article ([Fig 1](#pone.0225795.g001){ref-type="fig"}) has been modeled using FreeCAD Python.

### Tool development {#sec035}

To end this subsection we analyze both projects in terms of their development. The objective is to compare the data publicly available in an attempt to obtain some metrics in order to characterize the development. We have chosen some of the metrics suggested by Crowston and Howison \[[@pone.0225795.ref069]\], such as the number of developers (contributors), the level of activity (commits), cycle time (releases) and popularity (downloads). We also include the number of lines of code to offer a intuitive metric of the project size. The information have been gathered from \[[@pone.0225795.ref070]\] \[[@pone.0225795.ref071]\] \[[@pone.0225795.ref072]\] and the projects website, although we could not find download statistics for OpenSCAD.

We observe from [Table 7](#pone.0225795.t007){ref-type="table"} that although both projects have a high level of activity, FreeCAD is notably more active and have frequents releases. That could be predicted since a graphical CAD tool would attract more users than a scripting CAD tool. However, from the analysis of the contributions on parametric OSH for scientific equipment, we would think that there probably are many more users of OpenSCAD than FreeCAD Python scripts.

10.1371/journal.pone.0225795.t007

###### General project metrics.

![](pone.0225795.t007){#pone.0225795.t007g}

  Metric                                                                      OpenSCAD    FreeCAD
  --------------------------------------------------------------------------- ----------- --------------------
  Lines of code[^a^](#t007fn001){ref-type="table-fn"}                         129,641     3,181,812
  Commits during last year[^b^](#t007fn002){ref-type="table-fn"}              1,327       3,469
  Contributors during last year[^b^](#t007fn002){ref-type="table-fn"}         32          112
  Latest release                                                              May 2019    (0.18.3) July 2019
  Latest major release                                                        May 2019    (0.18.0) Mar. 2019
  Previous major release                                                      Mar. 2015   (0.17.0) Apr. 2018
  Downloads of latest major release[^c^](#t007fn003){ref-type="table-fn"}     N/A         (0.18) 1,298,693
  Downloads of previous major release[^c^](#t007fn003){ref-type="table-fn"}   N/A         (0.17) 1,698,323

^a^Not including comment lines or blank lines.

^b^From Sep. 2018 to Sep. 2019.

^c^Including all minor releases. Downloads until Sep. 25th, 2019.

Summary {#sec036}
-------

To recapitulate, OpenSCAD is easy to setup and its modeling language hides the low level details related to the internal data structures and their interaction with the geometry kernel. Consequently, OpenSCAD is accessible to the non-expert programmer and allows designers to focus on the CAD modeling.

However, OpenSCAD functional programming paradigm and its scoping rules may seem cumbersome for those who are not used to them. Nonetheless, OpenSCAD main drawback is that its kernel works with tessellated models, in which the parametric geometry is lost. As a result, the interoperability with other CAD tools is dramatically reduced since it is not able to export to standard parametric formats.

On the other hand, FreeCAD Python users need a programming language background to deal with the setup and the intricate programming structures that are exposed. However, installing FreeCAD CadQuery workbench allows FreeCAD users to avoid the setup difficulties and provides them with a friendlier coding interface. Once this barrier is overcome, the FreeCAD Python designer can enjoy a design tool that provides a plethora of advantages, such as exporting to standard parametric formats, using CadQuery library and any other Python libraries, and incorporating the scripted models into its graphical user interface, among many others.

Finally, [Table 8](#pone.0225795.t008){ref-type="table"} outlines the comparison of both tools.

10.1371/journal.pone.0225795.t008

###### Tool characteristics summary.

The table is divided in the four topics: (1) geometric modeling kernel; (2) easy of use, (3) programming languages characteristics and (4) tool features.

![](pone.0225795.t008){#pone.0225795.t008g}

  Topic                                                    OpenSCAD                                                   FreeCAD Python
  -------------------------------------------------------- ---------------------------------------------------------- --------------------------------------------------
  KERN                                                     Computational Geometry Algorithms Library (CGAL)           Open Cascade Technology (OCCT)
  Based on Constructive Solid geometry (CSG)               Based on boundary representation (B-rep)                   
  Polygonal mesh model                                     Parametric model (B-rep)                                   
  EASY                                                     Usable, easy to setup                                      Complex setup---Improved with CadQuery workbench
  Easy to learn: reduced set of primitives and functions   Complex to learn: many kind of functions and objects       
  Easy to learn: higher abstraction level                  Complex to learn: dealing with kernel structure            
  Step-by-step thorough tutorials                          Few scripting tutorials---Good tutorials for CadQuery      
  PROG                                                     Parametric design, code based, version control             Parametric design, code based, version control
  Specific programming language                            Widespread programming language (Python)                   
  Declarative, purely functional paradigm                  Multi-paradigm, including procedural and object-oriented   
  Cumbersome scoping rules                                 Scope of variables can be defined                          
  Data types: number, boolean, string, range, vector       Whole range of Python data types and user defined          
  Specific OpenSCAD libraries                              Specific FreeCAD libraries                                 
  No libraries other than from OpenSCAD                    Python libraries provide solutions to countless problems   
  Not good at handling input/output text files             All kind of functions to read/write text files             
  No fillet or chamfer transformations                     Fillet and chamfer transformations                         
  Minkowski and Hull transformations                       No Minkowski or Hull transformations                       
  TOOL                                                     Multiplatform FOSS under GPL2                              Multiplatform FOSS under LGPL2+
  No modifications through GUI                             All kind of transformations through the GUI                
  No script integration in GUI                             Scripts can be integrated in the GUI                       
  No import/export to standard parametric formats          Import/export to standard parametric formats               
  Slow model generation                                    Fast model generation                                      
  Difficult for system modeling                            Suitable for system modeling                               
  Vibrant community creating OSH scientific equipment      Almost no one creating open source labware                 
  Active software development project                      Very active software development project                   

KERN, geometric modeling kernel; EASY, Easy of use; PROG, programming language characteristics; TOOL, tool features.

Positive features are shaded in light blue. Negative features are shaded in light red. Non shaded cell describe neutral features or that could be considered positive or negative. Negative FreeCAD features that improve when using the CadQuery workbench are shaded yellow.

Conclusions {#sec037}
===========

Designing open source scientific hardware using a programming language offers two clear benefits: it allows parametric design and provides a source code for the hardware. Parametric is design is a highly desirable characteristic for open source labware because it enables customization to suit different experiment purposes. On the other hand, providing a source code for the hardware helps to make the hardware truly open by mending the lack of enough documentation that OSH have.

Designing open source hardware using Python for FreeCAD has distinct advantages over OpenSCAD. We consider that the longer learning curve of Python for FreeCAD is largely compensated by three major benefits. First, the ability to export to standard parametric CAD formats. Secondly, the usage of a widespread programming language with an extensive standard library. Lastly, the ability to use and integrate the generated models and the scripts in the FreeCAD graphical interface; thus, allowing non-programmers designers to use and configure the models.

In the light of these clear benefits, we hope that our analysis and companion step-by-step tutorials will encourage the scientific community to adopt Python for FreeCAD for modeling parametric open source scientific equipment.

Future work will involve (1) the creation of modules to isolate the CAD designer from the lower level kernel structures; (2) the integration of the scripted models in the FreeCAD graphical interface to allow non-programmers to easily parametrize the designs; and (3) exploration of methodologies to aid parametric system modeling.

10.1371/journal.pone.0225795.r001

Decision Letter 0

Al-Ameri

Talib

Academic Editor

© 2019 Talib Al-Ameri

2019

Talib Al-Ameri

This is an open access article distributed under the terms of the

Creative Commons Attribution License

, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.

12 Sep 2019

PONE-D-19-22759

Parametric CAD modeling for open source scientific hardware: comparing OpenSCAD and FreeCAD Python scripts

PLOS ONE

Dear Mr Machado,

Thank you for submitting your manuscript to PLOS ONE. After careful consideration, we feel that it has merit but does not fully meet PLOS ONE's publication criteria as it currently stands. Therefore, we invite you to submit a revised version of the manuscript that addresses the points raised during the review process.

To facilitate a timely publication, your revised manuscript should be uploaded as soon as possible.

We would appreciate receiving your revised manuscript by Oct 27 2019 11:59PM. When you are ready to submit your revision, log on to <https://www.editorialmanager.com/pone/> and select the \'Submissions Needing Revision\' folder to locate your manuscript file.

If you would like to make changes to your financial disclosure, please include your updated statement in your cover letter.

To enhance the reproducibility of your results, we recommend that if applicable you deposit your laboratory protocols in protocols.io, where a protocol can be assigned its own identifier (DOI) such that it can be cited independently in the future. For instructions see: <http://journals.plos.org/plosone/s/submission-guidelines#loc-laboratory-protocols>

Please include the following items when submitting your revised manuscript:

A rebuttal letter that responds to each point raised by the academic editor and reviewer(s). This letter should be uploaded as separate file and labeled \'Response to Reviewers\'.A marked-up copy of your manuscript that highlights changes made to the original version. This file should be uploaded as separate file and labeled \'Revised Manuscript with Track Changes\'.An unmarked version of your revised paper without tracked changes. This file should be uploaded as separate file and labeled \'Manuscript\'.

Please note while forming your response, if your article is accepted, you may have the opportunity to make the peer review history publicly available. The record will include editor decision letters (with reviews) and your responses to reviewer comments. If eligible, we will contact you to opt in or out.

We look forward to receiving your revised manuscript.

Kind regards,

Talib Al-Ameri, Ph.D

Academic Editor

PLOS ONE

Journal Requirements:

1\. When submitting your revision, we need you to address these additional requirements.

Please ensure that your manuscript meets PLOS ONE\'s style requirements, including those for file naming. The PLOS ONE style templates can be found at

<http://www.journals.plos.org/plosone/s/file?id=wjVg/PLOSOne_formatting_sample_main_body.pdf> and <http://www.journals.plos.org/plosone/s/file?id=ba62/PLOSOne_formatting_sample_title_authors_affiliations.pdf>

2\. We suggest you thoroughly copyedit your manuscript for language usage, spelling, and grammar. If you do not know anyone who can help you do this, you may wish to consider employing a professional scientific editing service.  

Whilst you may use any professional scientific editing service of your choice, PLOS has partnered with both American Journal Experts (AJE) and Editage to provide discounted services to PLOS authors. Both organizations have experience helping authors meet PLOS guidelines and can provide language editing, translation, manuscript formatting, and figure formatting to ensure your manuscript meets our submission guidelines. To take advantage of our partnership with AJE, visit the AJE website (<http://learn.aje.com/plos/>) for a 15% discount off AJE services. To take advantage of our partnership with Editage, visit the Editage website ([www.editage.com](http://www.editage.com)) and enter referral code PLOSEDIT for a 15% discount off Editage services.  If the PLOS editorial team finds any language issues in text that either AJE or Editage has edited, the service provider will re-edit the text for free.

Upon resubmission, please provide the following:

The name of the colleague or the details of the professional service that edited your manuscriptA copy of your manuscript showing your changes by either highlighting them or using track changes (uploaded as a \*supporting information\* file)A clean copy of the edited manuscript (uploaded as the new \*manuscript\* file)

3.  We note that Figures in your submission contain copyrighted images. All PLOS content is published under the Creative Commons Attribution License (CC BY 4.0), which means that the manuscript, images, and Supporting Information files will be freely available online, and any third party is permitted to access, download, copy, distribute, and use these materials in any way, even commercially, with proper attribution. For more information, see our copyright guidelines: <http://journals.plos.org/plosone/s/licenses-and-copyright>.

We require you to either (1) present written permission from the copyright holder to publish these figures specifically under the CC BY 4.0 license, or (2) remove the figures from your submission:

1.         You may seek permission from the original copyright holder of Figure(s) to publish the content specifically under the CC BY 4.0 license.

We recommend that you contact the original copyright holder with the Content Permission Form (<http://journals.plos.org/plosone/s/file?id=7c09/content-permission-form.pdf>) and the following text:

"I request permission for the open-access journal PLOS ONE to publish XXX under the Creative Commons Attribution License (CCAL) CC BY 4.0 (<http://creativecommons.org/licenses/by/4.0/>). Please be aware that this license allows unrestricted use and distribution, even commercially, by third parties. Please reply and provide explicit written permission to publish XXX under a CC BY license and complete the attached form."

Please upload the completed Content Permission Form or other proof of granted permissions as an \"Other\" file with your submission. 

In the figure caption of the copyrighted figure, please include the following text: "Reprinted from \[ref\] under a CC BY license, with permission from \[name of publisher\], original copyright \[original copyright year\]."

2.    If you are unable to obtain permission from the original copyright holder to publish these figures under the CC BY 4.0 license or if the copyright holder's requirements are incompatible with the CC BY 4.0 license, please either i) remove the figure or ii) supply a replacement figure that complies with the CC BY 4.0 license. Please check copyright information on all replacement figures and update the figure caption with source information. If applicable, please specify in the figure caption text when a figure is similar but not identical to the original image and is therefore for illustrative purposes only.

\[Note: HTML markup is below. Please do not edit.\]

Reviewers\' comments:

Reviewer\'s Responses to Questions

**Comments to the Author**

1\. Is the manuscript technically sound, and do the data support the conclusions?

The manuscript must describe a technically sound piece of scientific research with data that supports the conclusions. Experiments must have been conducted rigorously, with appropriate controls, replication, and sample sizes. The conclusions must be drawn appropriately based on the data presented.

Reviewer \#1: Yes

Reviewer \#2: Yes

Reviewer \#3: Yes

\*\*\*\*\*\*\*\*\*\*

2\. Has the statistical analysis been performed appropriately and rigorously?

Reviewer \#1: Yes

Reviewer \#2: Yes

Reviewer \#3: Yes

\*\*\*\*\*\*\*\*\*\*

3\. Have the authors made all data underlying the findings in their manuscript fully available?

The [PLOS Data policy](http://www.plosone.org/static/policies.action#sharing) requires authors to make all data underlying the findings described in their manuscript fully available without restriction, with rare exception (please refer to the Data Availability Statement in the manuscript PDF file). The data should be provided as part of the manuscript or its supporting information, or deposited to a public repository. For example, in addition to summary statistics, the data points behind means, medians and variance measures should be available. If there are restrictions on publicly sharing data---e.g. participant privacy or use of data from a third party---those must be specified.

Reviewer \#1: Yes

Reviewer \#2: Yes

Reviewer \#3: Yes

\*\*\*\*\*\*\*\*\*\*

4\. Is the manuscript presented in an intelligible fashion and written in standard English?

PLOS ONE does not copyedit accepted manuscripts, so the language in submitted articles must be clear, correct, and unambiguous. Any typographical or grammatical errors should be corrected at revision, so please note any specific errors here.

Reviewer \#1: Yes

Reviewer \#2: Yes

Reviewer \#3: Yes

\*\*\*\*\*\*\*\*\*\*

5\. Review Comments to the Author

Please use the space provided to explain your answers to the questions above. You may also include additional comments for the author, including concerns about dual publication, research ethics, or publication ethics. (Please upload your review as an attachment if it exceeds 20,000 characters)

Reviewer \#1: The manuscript mainly presents an analysis study of OpenSCAD and compare it with FreeCAD Python scripts. The authors also created a parametric open source hardware design to compare these tools.

The manuscript is of interest to the PlosOne readership. The introduction provides sufficient background and include all relevant references. The research design is appropriate. The methods adequately described. The results clearly presented. The scientific style of presentation is high enough.

However, the introduction is too long, I would recommend authors to summaries the motivation.

(Line 73) The authors mentioned some other FOSS CAD tools available to create solid models using a programming language, such as FreeCAD, PythonOCC, CadQuery and BRL-CAD. Among these CAD tools, Among these CAD tools, we have found FreeCAD to be the most active, having around a major release each year,..etc. Could you please compare the interesting features of OpenSCAD and FreeCAD with FreeCAD, PythonOCC, CadQuery and BRL-CAD.

(line 262) \*.scad

The main references are WWW, we recommend the authors to cite research articles if applicable. The readership usually couldn't reach web sites for some cases and that happens for many reasons for example changing/removing the web address when a company acquired by another compony.

The flowing references are a web address; 2, 3, 4, 7, 12, 14, 21,22,30, 34, 3,36,37,38,39,40, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 56, 57, and 58.

Reference \[5\] missing the doi.

Reference \[9\] missing the doi.

Reference \[13\] missing the doi.

Reference \[15\] is a book but missing the doi.

Reference \[16\] please check the order of the authors; Luis Felipe Rosado Murillo then Matti Veikko Pietari Kauttu.

Reference \[32\] missing doi. [doi.org/10.1007/978-3-662-44468-9_53](http://doi.org/10.1007/978-3-662-44468-9_53).

Reference \[42\] missing doi. 10.1201/9781315119601.

Reviewer \#2: After reviewing the manuscript entitled "Parametric CAD modeling for open source scientific hardware: comparing OpenSCAD and FreeCAD Python scripts" (PONE-D-19-22759).

Here are my reviewing points:

The manuscript comparing OpenSCAD and FreeCAD. The work did provide some insight that can potentially guide the developers to improve the CAD modeling using open source scientific hardware.

1\. The comparison was comprehensive and the authors provided sufficient resources.

2\. The authors provided sufficient and good literature background.

3\. The featured of both OpenSCAD and FreeCAD were analyzed fairly.

4\. The major drawback is that this manuscript fits to be a case study rather than a research article. However, in both cases it is still valuable and interesting.

5\. typos line (73) (The) should be (There).

6\. In table (7), the authors mentioned that it is divided into (three) topics, but it seems that there are (four) topics discussed in the table as mentioned in line (238), which are (the geometric modeling kernel, the usability, the programming language characteristics and the tool features), so its need to be corrected to (four) topics in the title of the table.

7\. The authors have to follow one format for the references, and I would suggest them to mentioned the access time for websites.

Reviewer \#3: I know several groups working on parametric CAD modeling for open source scientific hardware and they demonstrated progress however there is no single comprehensive study compares such type of CADs (in my knowledge).

The authors present an analysis study of prevalent modeling CADs (OpenSCAD and FreeCAD). They created a parametric open source hardware design to compare OpenSCAD and FreeCAD . The authers also describe methodology of comparison and they provided necessary scripts and supplementary documents.

The main advantage of this paper is the systematic analysis. It feels that the authors predicted readership's questions, so they put consequent answers. The paper is of interest for many PlosOne's auditory. The done works of other groups and researchers are accurately acknowledged, I would recommend to publish this manuscript after minor corrections.

My main concern is about the motivation for the authors to publish their study in a journal while they have already deposited scripts elsewhere (github). I would recommend authors to explain that in the introduction. The bibliography needs some attention according to the journal instructions.

\*\*\*\*\*\*\*\*\*\*

6\. PLOS authors have the option to publish the peer review history of their article ([what does this mean?](https://journals.plos.org/plosone/s/editorial-and-peer-review-process#loc-peer-review-history)). If published, this will include your full peer review and any attached files.

If you choose "no", your identity will remain anonymous but your review may still be made public.

**Do you want your identity to be public for this peer review?** For information about this choice, including consent withdrawal, please see our [Privacy Policy](https://www.plos.org/privacy-policy).

Reviewer \#1: No

Reviewer \#2: No

Reviewer \#3: No

\[NOTE: If reviewer comments were submitted as an attachment file, they will be attached to this email and accessible via the submission site. Please log into your account, locate the manuscript record, and check for the action link \"View Attachments\". If this link does not appear, there are no attachment files to be viewed.\]

While revising your submission, please upload your figure files to the Preflight Analysis and Conversion Engine (PACE) digital diagnostic tool, <https://pacev2.apexcovantage.com/>. PACE helps ensure that figures meet PLOS requirements. To use PACE, you must first register as a user. Registration is free. Then, login and navigate to the UPLOAD tab, where you will find detailed instructions on how to use the tool. If you encounter any issues or have any questions when using PACE, please email us at <figures@plos.org>. Please note that Supporting Information files do not need this step.

10.1371/journal.pone.0225795.r002

Author response to Decision Letter 0

28 Oct 2019

Reviewer \#1:

However, the introduction is too long, I would recommend authors to summaries the motivation.

\- We have attempted to reduce the introduction length, but since other reviewer believed that the introduction was adequate, we were afraid to remove important background information. Thus, we have barely been able to reduce it.

\-\--

(Line 73) The authors mentioned some other FOSS CAD tools available to create solid models using a programming language, such as FreeCAD, PythonOCC, CadQuery and BRL-CAD. Among these CAD tools, Among these CAD tools, we have found FreeCAD to be the most active, having around a major release each year,..etc. Could you please compare the interesting features of OpenSCAD and FreeCAD with FreeCAD, PythonOCC, CadQuery and BRL-CAD.

\- The reviewer\'s comment is relevant. We have created a new section with an extended explanation of the features of these FOSS CAD tools. In this section we have explained why we have chosen FreeCAD and also have included the FreeCAD CadQuery workbench in the subsequent analysis. This FreeCAD workbench facilitates the use of Python scripts in FreeCAD, and thus, supports the use of FreeCAD. We believe that with this addition the manuscript is more comprehensive. Besides, we have added included the CadQuery models in the software repository.

\-\--

(line 262) \*.scad

\- Corrected.

\-\--

The main references are WWW, we recommend the authors to cite research articles if applicable. The readership usually couldn't reach web sites for some cases and that happens for many reasons for example changing/removing the web address when a company acquired by another compony.

The flowing references are a web address; 2, 3, 4, 7, 12, 14, 21,22,30, 34, 3,36,37,38,39,40, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 56, 57, and 58.

\- The WWW are mainly from computer programs, associations and projects statistics that we have not been able to find research articles with that information. However, all the WWW references have been archived and should be available at any time with the information at the time of archive.

\-\--

Reference \[5\] missing the doi.

\- Corrected. In the revised manuscript, this reference is \[4\].

Reference \[9\] missing the doi.

\- Corrected. In the revised manuscript, this reference is \[8\].

Reference \[13\] missing the doi.

\- We could not find the doi, but we added where it is available. In the revised manuscript, this reference is \[12\].

Reference \[15\] is a book but missing the doi.

\- We could not find the doi, but the ISBN (9780133373905) could be added if necessary. In the revised manuscript, this reference is \[14\].

Reference \[16\] please check the order of the authors; Luis Felipe Rosado Murillo then Matti Veikko Pietari Kauttu.

\- Corrected. In the revised manuscript, this reference is \[15\].

Reference \[32\] missing doi. [doi.org/10.1007/978-3-662-44468-9_53](http://doi.org/10.1007/978-3-662-44468-9_53).

\- Corrected.

Reference \[42\] missing doi. 10.1201/9781315119601.

\- Corrected. In the revised manuscript, this reference is \[53\].

\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--

Reviewer \#2:

5\. typos line (73) (The) should be (There).

\- Corrected.

6\. In table (7), the authors mentioned that it is divided into (three) topics, but it seems that there are (four) topics discussed in the table as mentioned in line (238), which are (the geometric modeling kernel, the usability, the programming language characteristics and the tool features), so its need to be corrected to (four) topics in the title of the table.

\- Corrected.

7\. The authors have to follow one format for the references, and I would suggest them to mentioned the access time for websites.

\- The format of the references have been corrected. We have added the archived link with its archive date in order to have a permanent link at the time of archive.

\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--

Reviewer \#3:

My main concern is about the motivation for the authors to publish their study in a journal while they have already deposited scripts elsewhere (github). I would recommend authors to explain that in the introduction.

\- We have deposited the scripts in github to be in compliance with PLOS ONE software sharing policy: "We expect that all researchers submitting to PLOS submissions in which software is the central part of the manuscript will make all relevant software available without restrictions upon publication of the work".

In the third section (Open hardware models created as test-bench), in line 172 of the revised marked-up copy, we have included an explanation about the availability of the associated scripted models.

\-\--

The bibliography needs some attention according to the journal instructions.

\- Corrected.

###### 

Submitted filename: response_reviewers.pdf

###### 

Click here for additional data file.

10.1371/journal.pone.0225795.r003

Decision Letter 1

Al-Ameri

Talib

Academic Editor

© 2019 Talib Al-Ameri

2019

Talib Al-Ameri

This is an open access article distributed under the terms of the

Creative Commons Attribution License

, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.

13 Nov 2019

Parametric CAD modeling for open source scientific hardware: comparing OpenSCAD and FreeCAD Python scripts

PONE-D-19-22759R1

Dear Dr. Machado,

We are pleased to inform you that your manuscript has been judged scientifically suitable for publication and will be formally accepted for publication once it complies with all outstanding technical requirements.

Within one week, you will receive an e-mail containing information on the amendments required prior to publication. When all required modifications have been addressed, you will receive a formal acceptance letter and your manuscript will proceed to our production department and be scheduled for publication.

Shortly after the formal acceptance letter is sent, an invoice for payment will follow. To ensure an efficient production and billing process, please log into Editorial Manager at <https://www.editorialmanager.com/pone/>, click the \"Update My Information\" link at the top of the page, and update your user information. If you have any billing related questions, please contact our Author Billing department directly at <authorbilling@plos.org>.

If your institution or institutions have a press office, please notify them about your upcoming paper to enable them to help maximize its impact. If they will be preparing press materials for this manuscript, you must inform our press team as soon as possible and no later than 48 hours after receiving the formal acceptance. Your manuscript will remain under strict press embargo until 2 pm Eastern Time on the date of publication. For more information, please contact <onepress@plos.org>.

With kind regards,

Talib Al-Ameri, Ph.D

Academic Editor

PLOS ONE

Additional Editor Comments (optional):

Reviewers\' comments:

Reviewer\'s Responses to Questions

**Comments to the Author**

1\. Reviewer 3 has repeated the same comments as in round 1. I think the authors have adequately addressed all comments raised in a previous round of review and I feel that this manuscript is now acceptable for publication.

Reviewer \#1: (No Response)

Reviewer \#2: All comments have been addressed

Reviewer \#3: All comments have been addressed

\*\*\*\*\*\*\*\*\*\*

2\. Is the manuscript technically sound, and do the data support the conclusions?

The manuscript must describe a technically sound piece of scientific research with data that supports the conclusions. Experiments must have been conducted rigorously, with appropriate controls, replication, and sample sizes. The conclusions must be drawn appropriately based on the data presented.

Reviewer \#1: (No Response)

Reviewer \#2: Yes

Reviewer \#3: Yes

\*\*\*\*\*\*\*\*\*\*

3\. Has the statistical analysis been performed appropriately and rigorously?

Reviewer \#1: (No Response)

Reviewer \#2: Yes

Reviewer \#3: Yes

\*\*\*\*\*\*\*\*\*\*

4\. Have the authors made all data underlying the findings in their manuscript fully available?

The [PLOS Data policy](http://www.plosone.org/static/policies.action#sharing) requires authors to make all data underlying the findings described in their manuscript fully available without restriction, with rare exception (please refer to the Data Availability Statement in the manuscript PDF file). The data should be provided as part of the manuscript or its supporting information, or deposited to a public repository. For example, in addition to summary statistics, the data points behind means, medians and variance measures should be available. If there are restrictions on publicly sharing data---e.g. participant privacy or use of data from a third party---those must be specified.

Reviewer \#1: (No Response)

Reviewer \#2: Yes

Reviewer \#3: Yes

\*\*\*\*\*\*\*\*\*\*

5\. Is the manuscript presented in an intelligible fashion and written in standard English?

PLOS ONE does not copyedit accepted manuscripts, so the language in submitted articles must be clear, correct, and unambiguous. Any typographical or grammatical errors should be corrected at revision, so please note any specific errors here.

Reviewer \#1: (No Response)

Reviewer \#2: Yes

Reviewer \#3: Yes

\*\*\*\*\*\*\*\*\*\*

6\. Review Comments to the Author

Please use the space provided to explain your answers to the questions above. You may also include additional comments for the author, including concerns about dual publication, research ethics, or publication ethics. (Please upload your review as an attachment if it exceeds 20,000 characters)

Reviewer \#1: (No Response)

Reviewer \#2: The authors have addressed my comments that I had raised in a previous round of review and I feel that this manuscript is now acceptable for publication.

The paper is well organized and clearly written. The technical quality of the manuscript is satisfactory. The length of the manuscript is now seems good, where most repeated sections are manipulated.

Reviewer \#3: (same comments of round 1)

\*\*\*\*\*\*\*\*\*\*

7\. PLOS authors have the option to publish the peer review history of their article ([what does this mean?](https://journals.plos.org/plosone/s/editorial-and-peer-review-process#loc-peer-review-history)). If published, this will include your full peer review and any attached files.

If you choose "no", your identity will remain anonymous but your review may still be made public.

**Do you want your identity to be public for this peer review?** For information about this choice, including consent withdrawal, please see our [Privacy Policy](https://www.plos.org/privacy-policy).

Reviewer \#1: No

Reviewer \#2: No

Reviewer \#3: Yes

10.1371/journal.pone.0225795.r004

Acceptance letter

Al-Ameri

Talib

Academic Editor

© 2019 Talib Al-Ameri

2019

Talib Al-Ameri

This is an open access article distributed under the terms of the

Creative Commons Attribution License

, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.

19 Nov 2019

PONE-D-19-22759R1

Parametric CAD modeling for open source scientific hardware: comparing OpenSCAD and FreeCAD Python scripts

Dear Dr. Machado:

I am pleased to inform you that your manuscript has been deemed suitable for publication in PLOS ONE. Congratulations! Your manuscript is now with our production department.

If your institution or institutions have a press office, please notify them about your upcoming paper at this point, to enable them to help maximize its impact. If they will be preparing press materials for this manuscript, please inform our press team within the next 48 hours. Your manuscript will remain under strict press embargo until 2 pm Eastern Time on the date of publication. For more information please contact <onepress@plos.org>.

For any other questions or concerns, please email <plosone@plos.org>.

Thank you for submitting your work to PLOS ONE.

With kind regards,

PLOS ONE Editorial Office Staff

on behalf of

Dr. Talib Al-Ameri

Academic Editor

PLOS ONE

[^1]: **Competing Interests:**The authors have declared that no competing interests exist.
