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....