A lego brick consists of a lego brick body, studs on top of the lego brick and receiver tubes inside the brick. The studs are arranged in...
Run
harbor run -t gnucleus-ai/freecad-893b9137ff
Download
harbor download gnucleus-ai/freecad-893b9137ff
Details
Revision
2
Published
Sep 3, 2026
Visibility
Public
Authors
gNucleus AI, Inc.
Content hash
Keywords
freecad
cad
parametric
geometry
python
Write a FreeCAD Python script to answer.py that reproduces the
part described below.
The model must be built as a parametric feature tree inside a single PartDesign Body,
producing exactly one solid body. Use editable PartDesign features to construct the
model for better parameterization.The saved FCStd must contain named document objects
whose properties drive the geometry, not a single Part::Feature holding
a pre-computed TopoShape.
Save the generated model as an .FCStd file next to the script, using
the script stem as the output basename. The output path must be derived
from __file__ at runtime; do not hardcode the path or rely on the
current working directory. Only the FCStd written next to the executing
script file is graded.
Part description:
A lego brick consists of a lego brick body, studs on top of the lego brick and receiver tubes inside the brick. The studs are arranged in an MxN matrix, where M represents the number of rows and N represents the number of columns of studs. For example, a 2x4 lego indicates the presence of 2 rows and 4 columns of studs atop the brick.
A lego brick is normally defined by lego_unit_length, lego_unit_length, lego_height, lego_thickness, num_studs_rows, num_studs_columns, studs_distance, stud_center, stud_diameter, stud_height, tube_center, tube_outer_diameter, tube_inner_diameter, tube_distance, etc.
Output location: write your script to /app/answer.py and the generated model to /app/answer.FCStd. The verifier reads from these exact paths; files saved anywhere else are not graded.