Trying to install/use Fullcontrolgcode

5 views
Skip to first unread message

William Adams

unread,
Dec 13, 2025, 8:12:10 AM (3 days ago) Dec 13
to PythonSCAD
I have the 3D previewing stuff working: https://github.com/WillAdams/gcodepreview/blob/main/gcpthreedp.py

but not doing well with calculating the extrusion rate or managing the multiplicity of 3D printer models/firmwares, so thought I would instead:

 - import the Python version of fullcontrolgcode
 - wrap its commands
 - generate the appropriate preview command in gcodepreview and gcode generation in fullcontrolgcode

Installing fullcontrolgcode seems to have worked:

    PS C:\Users\willa\OneDrive\Desktop> pip install fullcontrol
    Requirement already satisfied: fullcontrol in c:\users\willa\appdata\local\programs\python\python312\lib\site-packages (0.1.1)
    Requirement already satisfied: numpy in c:\users\willa\appdata\local\programs\python\python312\lib\site-packages (from fullcontrol) (2.2.3)
    Requirement already satisfied: plotly in c:\users\willa\appdata\local\programs\python\python312\lib\site-packages (from fullcontrol) (6.2.0)
    Requirement already satisfied: pydantic in c:\users\willa\appdata\local\programs\python\python312\lib\site-packages (from fullcontrol) (2.10.6)
    Requirement already satisfied: narwhals>=1.15.1 in c:\users\willa\appdata\local\programs\python\python312\lib\site-packages (from plotly->fullcontrol) (1.47.1)
    Requirement already satisfied: packaging in c:\users\willa\appdata\local\programs\python\python312\lib\site-packages (from plotly->fullcontrol) (25.0)
    Requirement already satisfied: annotated-types>=0.6.0 in c:\users\willa\appdata\local\programs\python\python312\lib\site-packages (from pydantic->fullcontrol) (0.7.0)
    Requirement already satisfied: pydantic-core==2.27.2 in c:\users\willa\appdata\local\programs\python\python312\lib\site-packages (from pydantic->fullcontrol) (2.27.2)
    Requirement already satisfied: typing-extensions>=4.12.2 in c:\users\willa\appdata\local\programs\python\python312\lib\site-packages (from pydantic->fullcontrol) (4.14.1)

but it doesn't work when I make a simple test file:

    # Simple FullControl example: generates a square G-code path
    # Requires: pip install fullcontrol

    from fullcontrol import FullControlProgram, Move

    def main():
        # Create a new FullControl program
        program = FullControlProgram()

        # Define print settings (units in mm)
        program.add(Move(x=0, y=0, z=0.2, speed=1500, extrude=False))  # Move to start
        program.add(Move(x=20, y=0, z=0.2, speed=1200, extrude=True))  # Draw first edge
        program.add(Move(x=20, y=20, z=0.2, speed=1200, extrude=True)) # Second edge
        program.add(Move(x=0, y=20, z=0.2, speed=1200, extrude=True))  # Third edge
        program.add(Move(x=0, y=0, z=0.2, speed=1200, extrude=True))   # Fourth edge

        # Save G-code to file
        output_file = "square_example.gcode"
        program.save_gcode(output_file)

        print(f"G-code saved to {output_file}")

    if __name__ == "__main__":
        try:
            main()
        except Exception as e:
            print(f"Error: {e}")
           
and try to run it:

    PS C:\Users\willa\OneDrive\Desktop> python square_example.py
    Traceback (most recent call last):
      File "C:\Users\willa\OneDrive\Desktop\square_example.py", line 4, in <module>
        from fullcontrol import FullControlProgram, Move
    ImportError: cannot import name 'FullControlProgram' from 'fullcontrol' (C:\Users\willa\AppData\Local\Programs\Python\Python312\Lib\site-packages\fullcontrol\__init__.py)
 
I'll try checking on /r/fullcontrol as well....

William Adams

unread,
Dec 13, 2025, 4:57:52 PM (3 days ago) Dec 13
to PythonSCAD
Okay, I have a file which seems to be working:

    # Simple FullControl example: generates a square G-code path
    # Requires: pip install fullcontrol

    import fullcontrol as fc

    # create an empty list called steps
    steps=[]
    # add points to the list
    steps.append(fc.Point(x=40,y=40,z=0.2))
    steps.append(fc.Point(x=50,y=50))
    steps.append(fc.Point(x=60,y=40))
    # turn the extruder on or off
    steps.append(fc.Extruder(on=False))
    steps.append(fc.Point(x=40,y=40,z=0.4))
    steps.append(fc.Extruder(on=True))
    steps.append(fc.Point(x=50,y=50))
    steps.append(fc.Point(x=60,y=40))
    # transform the design into a plot
    fc.transform(steps, 'plot')

    filename = 'my_design'
    printer = 'ender_3'
    # printer options: generic, ultimaker2plus, prusa_i3, ender_3, cr_10, bambulab_x1, toolchanger_T0, toolchanger_T1, toolchanger_T2, toolchanger_T3
    print_settings = {'extrusion_width': 0.5,'extrusion_height': 0.2, 'nozzle_temp': 210, 'bed_temp': 40, 'fan_percent': 100}
    # 'extrusion_width' and 'extrusion_height' are the width and height of the printed line)


when run in basic Python --- now to get it to work in OpenPythonSCAD in Windows ....

William

William Adams

unread,
Dec 13, 2025, 7:21:39 PM (3 days ago) Dec 13
to PythonSCAD
Have this file:

    import fullcontrol as fc

    # Define design parameters
    layer_height = 0.2

    # Create a list of steps
    steps = []
    steps.append(fc.Point(x=0, y=0, z=0))
    steps.append(fc.Point(x=10, y=0, z=0))
    steps.append(fc.Point(x=10, y=10, z=0))
    steps.append(fc.Point(x=0, y=10, z=0))
    steps.append(fc.Point(x=0, y=0, z=layer_height))

    # For visualization
    fc.transform(steps, 'plot', fc.PlotControls(style='line'))

    # For G-code
    gcode = fc.transform(steps, 'gcode', fc.GcodeControls(
        printer_name='prusa_i3',
        save_as='my_design',
        initialization_data={
            'print_speed': 1000,
            'nozzle_temp': 210,
            'bed_temp': 60
        }
    ))


working in Python after running 

pip install nbformat:

Screenshot 2025-12-13 192036.png

Now I just have to work out how to get these installed in OpenPythonSCAD and wrap things up to get a preview there.

William

William Adams

unread,
Dec 13, 2025, 7:46:18 PM (3 days ago) Dec 13
to PythonSCAD
I've been manually installing libraries into:

C:\Users\willa\OneDrive\Documents\OpenSCAD\libraries

which worked for pydantic and pydantic_core, but when I got to typing_extensions, installed 4.15 from:


but get:

>ImportError: cannot import name 'Sentinel' from 'typing_extensions' (unknown location)

Anyone know of a more up-to-date version? I can't find one....

William

William Adams

unread,
Dec 13, 2025, 8:04:57 PM (3 days ago) Dec 13
to PythonSCAD
Tried downloading from github, but no joy.


William

William Adams

unread,
Dec 13, 2025, 10:07:38 PM (3 days ago) Dec 13
to PythonSCAD
Apparently the problem is that this library is already installed.

Could we change things so that if a library is added to:

C:\Users\willa\OneDrive\Documents\OpenSCAD\libraries

it will be loaded instead of one which is already present elsewhere?

Or, document how to to update the libraries which are installed for use w/in OpenPythonSCAD? (somewhere that I can find it since I can't)

William

William Adams

unread,
Dec 14, 2025, 8:13:57 AM (2 days ago) Dec 14
to PythonSCAD
Tried replacing:

"C:\Users\willa\AppData\Local\Programs\Python\Python312\Lib\site-packages\typing_extensions.py"

but no joy (though maybe I should reboot?!?)

William
Reply all
Reply to author
Forward
0 new messages