### Install FullControl and Import Libraries Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/models/colab/star_polygon_lattice_colab.ipynb Installs the FullControl library if running in Google Colab and imports necessary modules for lattice generation and mathematical operations. Ensure you are in a Google Colab environment for the installation command to work. ```python if 'google.colab' in str(get_ipython()): !pip install git+https://github.com/FullControlXYZ/fullcontrol --quiet import fullcontrol as fc from google.colab import files import lab.fullcontrol as fclab from math import cos, sin, tau, pi, atan, sqrt, acos, radians from copy import deepcopy ``` -------------------------------- ### Install FullControl and Import Libraries Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/models/colab/nonplanar_spacer_colab.ipynb Installs the FullControl library if running in Google Colab and imports necessary modules. Ensure you are in a Colab environment for the installation command to work. ```python if 'google.colab' in str(get_ipython()): !pip install git+https://github.com/FullControlXYZ/fullcontrol --quiet import fullcontrol as fc from google.colab import files from math import cos, tau ``` -------------------------------- ### Install FullControl and Import Libraries Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/models/colab/blob_printing_colab.ipynb Installs the FullControl library if running in Google Colab and imports necessary modules. Ensure this is run before proceeding. ```python if 'google.colab' in str(get_ipython()): !pip install git+https://github.com/FullControlXYZ/fullcontrol --quiet import fullcontrol as fc from google.colab import files from math import tau ``` -------------------------------- ### Install FullControl Library Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tutorials/colab/fast_demo_colab.ipynb Installs the FullControl library from GitHub. This is typically run in a Colab environment. ```python if 'google.colab' in str(get_ipython()): !pip install git+https://github.com/FullControlXYZ/fullcontrol --quiet import fullcontrol as fc ``` -------------------------------- ### Install FullControl and Import Libraries Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tutorials/colab/lab_3mf_output_colab.ipynb Installs the FullControl library from GitHub if running in Google Colab and imports necessary modules. ```python if 'google.colab' in str(get_ipython()): !pip install git+https://github.com/FullControlXYZ/fullcontrol --quiet import fullcontrol as fc import lab.fullcontrol as fclab ``` -------------------------------- ### Create and Inspect Custom Primer Design Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tutorials/colab/gcode_controls_colab.ipynb Add a custom primer by including it at the beginning of the design steps. This example transforms the design to a 'plot' for easy inspection of primer and design start points. ```python design_steps = [fc.polar_to_point(centre=fc.Point(x=0, y=0, z=i*0.005), radius=10+10*(i%2), angle=i) for i in range(500)] primer_steps = fc.spiralXY(fc.Point(x=0, y=0, z=0.2), 2, 8, 0, 4, 128) steps = primer_steps + design_steps steps.append(fc.PlotAnnotation(point=fc.Point(x=2, y=0, z=0.2), label='primer start')) steps.append(fc.PlotAnnotation(point=fc.Point(x=10, y=0, z=0.1), label='design start')) steps.append(fc.PlotAnnotation(point=fc.Point(x=0, y=0, z=10), label='internal spiral-primer ends near the main-design start point')) fc.transform(steps, 'plot') ``` -------------------------------- ### Initialize Design Steps Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tutorials/plot_controls.ipynb Sets up a series of steps for a design, including helix generation, extruder on/off states, and plot annotations for start, extruder status, and finish points. This is a foundational step for most plotting examples. ```python import fullcontrol as fc # this demo design is used for most of the plots in this notebook centre_point = fc.Point(x=50, y=50, z=0) steps = fc.helixZ(centre_point, 20, 15, 0, 30, 0.15, 30*64) steps.append(fc.Extruder(on=False)) steps.append(fc.PlotAnnotation(label='extruder off')) steps.append(fc.Point(x=50, y=50, z=0)) steps.append(fc.Extruder(on=True)) steps.append(fc.PlotAnnotation(label='extruder on')) steps.append(fc.Point(z=5)) steps.append(fc.PlotAnnotation(label='finish')) steps.append(fc.PlotAnnotation(point=steps[0], label='start')) ``` -------------------------------- ### Install FullControl and Import Libraries Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/models/colab/design_template_colab.ipynb Installs the FullControl library from GitHub and imports necessary modules. This cell should be run first in a Google Colab environment. ```python if 'google.colab' in str(get_ipython()): !pip install git+https://github.com/FullControlXYZ/fullcontrol --quiet import fullcontrol as fc from google.colab import files ``` -------------------------------- ### Install and Import FullControl Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tutorials/colab/geometry_functions_colab.ipynb Installs the FullControl library and imports necessary modules. This is typically run at the beginning of a Colab notebook. ```python if 'google.colab' in str(get_ipython()): !pip install git+https://github.com/FullControlXYZ/fullcontrol --quiet import fullcontrol as fc from math import tau, sin ``` -------------------------------- ### Install FullControl and Import Libraries Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/models/colab/hex_adapter_colab.ipynb Installs the FullControl library if running in Google Colab and imports necessary modules for the design process. ```python if 'google.colab' in str(get_ipython()): !pip install git+https://github.com/FullControlXYZ/fullcontrol --quiet import fullcontrol as fc from google.colab import files from math import tau from copy import deepcopy ``` -------------------------------- ### Install FullControl and Import Libraries Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/models/colab/ripple_texture_colab.ipynb Installs the FullControl library if running in Google Colab and imports necessary modules for the demo. Ensure you run this cell before proceeding. ```python if 'google.colab' in str(get_ipython()): !pip install git+https://github.com/FullControlXYZ/fullcontrol --quiet import fullcontrol as fc from google.colab import files from math import cos, tau, sin from copy import deepcopy ``` -------------------------------- ### Example of fc.linspace Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tests/test_print_output_reference.txt Demonstrates the output of `fc.linspace(0,1,5)`, which generates a list of evenly spaced numbers between a start and end value. ```python fc.linspace(0,1,5) ``` -------------------------------- ### Install FullControl and Import Libraries Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/models/colab/anyangle_phone_stand_colab.ipynb Installs the FullControl library if running in Google Colab and imports necessary modules. Ensure this runs before other code cells. ```python if 'google.colab' in str(get_ipython()): !pip install git+https://github.com/FullControlXYZ/fullcontrol --quiet import fullcontrol as fc from google.colab import files from math import cos, sin, tau from copy import deepcopy ``` -------------------------------- ### Install FullControl and Import Libraries Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/models/colab/nuts_and_bolts_colab.ipynb Installs the FullControl library if running in Google Colab and imports necessary modules for design and plotting. ```python if 'google.colab' in str(get_ipython()): !pip install git+https://github.com/FullControlXYZ/fullcontrol --quiet import fullcontrol as fc from google.colab import files from math import tau import lab.fullcontrol as fclab ``` -------------------------------- ### Install FullControl Python Package Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/README.md Use this pip command to install the FullControl package directly from GitHub. Ensure you have Python, pip, and Git installed. ```bash pip install git+https://github.com/FullControlXYZ/fullcontrol ``` -------------------------------- ### G-code Example with Initialization Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tests/test_print_output_reference.txt This G-code snippet includes commands for setting relative extrusion, moving to the origin, pausing, and initiating extrusion, along with informational comments. ```gcode ; Time to print!!!!! ; GCode created with FullControl - tell us what you're printing! ; info@fullcontrol.xyz or tag FullControlXYZ on Twitter/Instagram/LinkedIn/Reddit/TikTok M83 ; relative extrusion G0 F8000 X0 Y0 Z0 G4 P2000 ; pause for 2 seconds G1 F1000 X10 E0.332601 ``` -------------------------------- ### Import FullControl Library Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/models/nonplanar_spacer.ipynb Imports the fullcontrol library and necessary math functions. Ensure the fullcontrol library is installed. ```python import fullcontrol as fc from math import cos, tau ``` -------------------------------- ### Import Libraries Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/models/star_polygon_lattice.ipynb Imports necessary libraries for FullControl, lab extensions, and mathematical functions. Ensure these are installed before running. ```python import fullcontrol as fc import lab.fullcontrol as fclab from math import cos, sin, tau, pi, atan, sqrt, acos, radians from copy import deepcopy ``` -------------------------------- ### Example Path Data Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tests/test_print_output_reference.txt Demonstrates the structure of path data including coordinates, extrusion properties, and color values. ```python xvals=[65.0, 50.0] yvals=[50.0, 50.0] zvals=[4.5, 0.0] colors=[[0.75, 0.5, 0.5], [0.75, 0.5, 0.5]] extruder=Extruder(on=False) widths=[0.4, 0.4] heights=[0.2, 0.2] ``` ```python xvals=[50.0, 50.0] yvals=[50.0, 50.0] zvals=[0.0, 5.0] colors=[[0, 0.0, 1], [0, 1.0, 1]] extruder=Extruder(on=True) widths=[0.4, 0.4] heights=[0.2, 0.2] ``` -------------------------------- ### G-code with Temperature Control and Offset Start Point Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tests/test_print_output_reference.txt This G-code includes commands to set hotend temperature and features an offset starting point. It's generated by FullControl. ```gcode ; Time to print!!!!! ; GCode created with FullControl - tell us what you're printing! ; info@fullcontrol.xyz or tag FullControlXYZ on Twitter/Instagram/LinkedIn/Reddit/TikTok M83 ; relative extrusion M104 S250 ; set hotend temp and continue M109 S250 ; set hotend temp and wait G0 F8000 X10.0 Y0.0 Z0.0 B0.0 C0.0 ; start point (x=0 in the model but x=10 in gcode due to the bc_intercept being at x=10) G1 F1000 X11.0 E0.03326 ; set x=1 - since b=0 and c=0, the model x-axis is oriented the same as the system x-axis G1 X10.7071 Z-0.707107 B45.0 E0 ; set b=45 - this causes a change to x and z in system coordinates ``` -------------------------------- ### Create a Demo Design Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tutorials/colab/plot_controls_colab.ipynb Generates a sample design using a helix path with annotations and extruder state changes. This design is used in subsequent plotting examples. ```python # this demo design is used for most of the plots in this notebook centre_point = fc.Point(x=50, y=50, z=0) steps = fc.helixZ(centre_point, 20, 15, 0, 30, 0.15, 30*64) steps.append(fc.Extruder(on=False)) steps.append(fc.PlotAnnotation(label='extruder off')) steps.append(fc.Point(x=50, y=50, z=0)) steps.append(fc.Extruder(on=True)) steps.append(fc.PlotAnnotation(label='extruder on')) steps.append(fc.Point(z=5)) steps.append(fc.PlotAnnotation(label='finish')) steps.append(fc.PlotAnnotation(point=steps[0], label='start')) ``` -------------------------------- ### G-code Generation Example 1 Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tests/test_print_output_reference.txt This G-code snippet demonstrates basic movement and fan speed control. It includes relative extrusion and a fan speed setting. ```gcode ; Time to print!!!!! ; GCode created with FullControl - tell us what you're printing! ; info@fullcontrol.xyz or tag FullControlXYZ on Twitter/Instagram/LinkedIn/Reddit/TikTok M83 ; relative extrusion G0 F8000 X0 Y0 Z0 G1 F1000 X10 E0.332601 M106 S191 ; set fan speed G0 F8000 X20 ``` -------------------------------- ### Example Bounding Box Data Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tests/test_print_output_reference.txt Illustrates the structure of bounding box data, providing minimum, maximum, mid-point, and range values for X, Y, and Z axes. ```python plot_data.bounding_box = minx=30.083333333333332 midx=50.041666666666664 maxx=70.0 rangex=39.91666666666667 miny=30.125 midy=50.041666666666664 maxy=69.95833333333333 rangey=39.83333333333333 minz=0.0 midz=2.5 maxz=5.0 rangez=5.0 ``` -------------------------------- ### Identify First Step and Point in Design Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tests/test_print_output_reference.txt Retrieves the first step and the first fully defined point from a design. Useful for initial analysis or setup of a 3D model. ```python first step in the design: Fan ``` ```python first point in the design (not fully defined): x=1.0 y=None z=None color=None ``` ```python first point in the design (fully defined): x=1.0 y=1.0 z=1.0 color=None ``` -------------------------------- ### Basic FullControl Usage Example Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/llm_ref.md Demonstrates defining design parameters, creating a list of steps using Point objects, and transforming these steps into visualization and G-code formats. Requires the 'fullcontrol' library. ```python 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 } )) ``` -------------------------------- ### Generate Spiral in XY Plane Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tutorials/colab/geometry_functions_colab.ipynb Generates a spiral in the XY plane. It is defined by a center point, start radius, end radius, start angle, number of turns, segments, and clockwise orientation. Annotations are added for the start, end, and center points, and the spiral is plotted. ```python centre_point = fc.Point(x=10, y=10, z=0) start_radius = 10 end_radius = 8 start_angle = 0 n_turns = 5 segments = 320 z_change = 0 clockwise = True steps = fc.spiralXY(centre_point, start_radius, end_radius, start_angle, n_turns, segments, clockwise) steps.append(fc.PlotAnnotation(point=steps[-1], label="end")) steps.append(fc.PlotAnnotation(point=steps[0], label="start")) steps.append(fc.PlotAnnotation(point=centre_point, label="centre")) fc.transform(steps, 'plot', fc.PlotControls(color_type='print_sequence', style='line')) ``` -------------------------------- ### Import and Basic 5-Axis Setup with Rotating Nozzle Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tutorials/lab_five_axis_demo.ipynb Use `lab.fullcontrol.fiveaxisC0B1` for systems where the nozzle rotates about the Y-axis and the print bed rotates about the Z-axis. This import replaces the general `lab.fullcontrol.fiveaxis` import. ```python import lab.fullcontrol.fiveaxisC0B1 as fc5 b_offset_z = 40 steps=[] steps.append(fc5.Point(x=0, y=0, z=0, b=0, c=0)) steps.append(fc5.GcodeComment(end_of_previous_line_text='start point')) steps.extend([fc5.Point(x=1), fc5.GcodeComment(end_of_previous_line_text='x=1')]) steps.extend([fc5.Point(c=90), fc5.GcodeComment(end_of_previous_line_text='c=90')]) steps.extend([fc5.Point(c=180), fc5.GcodeComment(end_of_previous_line_text='c=180')]) steps.extend([fc5.Point(c=270), fc5.GcodeComment(end_of_previous_line_text='c=270')]) steps.extend([fc5.Point(x=0, y=1, c=0), fc5.GcodeComment(end_of_previous_line_text='x=0, y=1, c=0')]) steps.extend([fc5.Point(c=90), fc5.GcodeComment(end_of_previous_line_text='c=90')]) steps.extend([fc5.Point(c=180), fc5.GcodeComment(end_of_previous_line_text='c=180')]) steps.extend([fc5.Point(c=270), fc5.GcodeComment(end_of_previous_line_text='c=270')]) steps.extend([fc5.Point(b=90), fc5.GcodeComment(end_of_previous_line_text='b=90')]) steps.extend([fc5.Point(b=-90), fc5.GcodeComment(end_of_previous_line_text='b=-90')]) print(fc5.transform(steps, 'gcode', fc5.GcodeControls(b_offset_z=b_offset_z))) ``` -------------------------------- ### Import FullControl and Math Libraries Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/models/anyangle_phone_stand.ipynb Imports the necessary FullControl library and math functions for design calculations. Ensure these are imported before proceeding. ```python import fullcontrol as fc from math import cos, sin, tau from copy import deepcopy ``` -------------------------------- ### Generate Arc in XY Plane Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tutorials/colab/geometry_functions_colab.ipynb Creates an arc in the XY plane. It is defined by a center point, radius, start angle, arc angle, and number of segments. Annotations are added for the start, end, and center points, and the arc is plotted. ```python centre_point = fc.Point(x=10, y=10, z=0) radius = 10 start_angle = 0 arc_angle = 0.75*tau segments = 64 steps = fc.arcXY(centre_point, radius, start_angle, arc_angle, segments) steps.append(fc.PlotAnnotation(point=steps[-1], label="end")) steps.append(fc.PlotAnnotation(point=steps[0], label="start")) steps.append(fc.PlotAnnotation(point=centre_point, label="centre")) fc.transform(steps, 'plot', fc.PlotControls(color_type='print_sequence', style='line')) ``` -------------------------------- ### Append and Extend Design Steps Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tutorials/colab/overview_colab.ipynb Demonstrates how to build a design step-by-step using Python's list 'append' and 'extend' methods. This allows for dynamic creation of step sequences. ```python # first, create an empty list steps = [] # then add single items to it with 'append' steps.append(fc.Point(x=10, y=10, z=0)) steps.append(fc.Point(x=20)) steps.append(fc.Point(x=10, y=20)) # to add multiple items to the list use 'extend' extra_steps = [fc.Point(x=50, y=50),fc.Point(x=60, y=60),fc.Point(x=70, y=70)] steps.extend(extra_steps) # transform the design to gcode and print to screen print(fc.transform(steps, 'gcode', show_tips=False)) ``` -------------------------------- ### Initialize M4 Lattice Row 1 Back Start Position Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/models/star_polygon_lattice.ipynb Initializes the starting X and Y coordinates for the 'back' repeating unit of the M4 lattice row 1. This calculation is based on the end point of row 1 and the relative positions of points within the repeating unit. ```python steplist_repeating_unit_back_start_x = steplist_row_1[-2].x+(steplist_repeating_unit[1].x-steplist_repeating_unit[0].x) steplist_repeating_unit_back_start_y = row_offset_y-(steplist_repeating_unit[7].y-steplist_repeating_unit[8].y-(steplist_repeating_unit[5].y-steplist_repeating_unit[7].y)) ``` -------------------------------- ### Generate Elliptical Arc in XY Plane Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tutorials/colab/geometry_functions_colab.ipynb Creates an elliptical arc in the XY plane. It is defined by a center point, semi-major axis (a), semi-minor axis (b), start angle, arc angle, and number of segments. Annotations are added for the start, end, and center points, and the arc is plotted. ```python centre_point = fc.Point(x=10, y=10, z=0) a = 10 b = 5 start_angle = 0 arc_angle = 0.75*tau segments = 64 steps = fc.elliptical_arcXY(centre_point, a, b, start_angle, arc_angle, segments) steps.append(fc.PlotAnnotation(point=steps[-1], label="end")) steps.append(fc.PlotAnnotation(point=steps[0], label="start")) steps.append(fc.PlotAnnotation(point=centre_point, label="centre")) fc.transform(steps, 'plot', fc.PlotControls(color_type='print_sequence', style='line')) ``` -------------------------------- ### Configure Printer and Design Parameters Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/models/colab/nuts_and_bolts_colab.ipynb Sets up essential parameters for 3D printing, including temperatures, speeds, and fan settings, along with design-specific variables like part type, dimensions, and thread properties. ```python # printer/gcode parameters design_name = 'nuts_and_bolts' nozzle_temp = 210 bed_temp = 40 print_speed = 1000 fan_percent = 100 printer_name='prusa_i3' # generic / ultimaker2plus / prusa_i3 / ender_3 / cr_10 / bambulab_x1 / toolchanger_T0 ``` ```python # design parameters part_type = 'wing_bolt' # wing_nut / wing_bolt / threaded_tube dia_major, dia_minor, pitch = 8.0, 6.75, 1.25 # M6: 6.0, 5.0, 1.0 / M8: 8.0, 6.75, 1.25 / M10: 10.0, 8.5, 1.5 / M12: 12.0, 10.25, 1.75 bolt_or_tube_thread_length = 20 # ignored for wing_nut part_type wing_height = 0.75 * dia_major # ignored for threaded_tube part_types clearance = 0.1 # this is the amount to undersize male threads or oversize female threads. if you 3D print both male and female threads, the clearance will effectively be doubled EH = 0.15 # extrusion height (layer height is set to this value) EW = 0.6 # extrusion width; recommended to be 1.5*nozzle_diameter ``` -------------------------------- ### Configure Printer and Design Parameters Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/models/colab/ripple_texture_colab.ipynb Sets up essential parameters for the 3D printing process, including temperatures, speeds, and printer model, as well as design-specific variables like radii, height, and ripple characteristics. ```python # printer/gcode parameters design_name = 'ripples' nozzle_temp = 210 bed_temp = 40 print_speed = 500 fan_percent = 100 printer_name='prusa_i3' # generic / ultimaker2plus / prusa_i3 / ender_3 / cr_10 / bambulab_x1 / toolchanger_T0 ``` ```python # design parameters inner_rad= 15 # Inner Radius (mm) - Radius of the inner circle - 'star tip' and 'bulge' parameters morph the geometry radially outwards from this value # default value: 15 ; guideline range: 10 to 30 height = 40 # Height (mm) - Height of the part # default value: 40 ; guideline range: 20 to 80 skew_percent = 10 # Twist (%) - How much does the structure twist over its height? 100% means one full rotation anti-clockwise # default value: 10 ; guideline range: -100 to 100 star_tips = 4 # Star Tips - The number of outward protrusions from a nominally circular geometry - to make a star-like shape # default value: 4 ; guideline range: 0 to 10 tip_length = 5 # Star Tip Length (mm) - How much does each 'star tip' protrude beyond the inner radius? # default value: 5 ; guideline range: -20 to 20 bulge = 2 # Bulge (mm) - The geometry bulges out by this amount half way up the structure # default value: 2 ; guideline range: -20 to 20 nozzle_dia = 0.4 # Nozzle Diameter (mm) - This is used to set a reasonable value for layer height and extrusion rate # default value: 0.4 ; guideline range: 0.3 to 1.2 ripples_per_layer = 50 # Ripples Per Layer - Number of in-out waves the nozzle performs for each layer. There is actually an extra half-ripple for each layer so that the ripples are offset for each alternating layer # default value: 50 ; guideline range: 20 to 100 rip_depth = 1 # Ripple Depth (mm) - How far the nozzle moves in and out radially for each 'ripple' # default value: 1 ; guideline range: 0 to 5 shape_factor = 1.5 # Start Tip Pointiness - This affects how pointy the 'star tips' are and can achieve very interesting geometries # default value: 1.5 ; guideline range: 0.25 to 5 RippleSegs = 2 # 2 means the ripple is zig-zag. increase this value to create a smooth wave, but watch out since the generation time will increase first_layer_E_factor = 0.4 # set to be 1 to double extrusion by the end of the layer, 0.4 adds 40%, which seemed good for me centre_x, centre_y = 50, 50 ``` -------------------------------- ### Generate Variable Radius Arc in XY Plane Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tutorials/colab/geometry_functions_colab.ipynb Generates an arc in the XY plane with a variable radius. It is defined by a center point, initial radius, start angle, arc angle, number of segments, radius change, and Z change. Annotations are added for the start, end, and center points, and the arc is plotted. ```python centre_point = fc.Point(x=10, y=10, z=0) radius = 10 start_angle = 0 arc_angle = 0.75*tau segments = 64 radius_change = -6 z_change = 0 steps = fc.variable_arcXY(centre_point, radius, start_angle, arc_angle, segments, radius_change, z_change) steps.append(fc.PlotAnnotation(point=steps[-1], label="end")) steps.append(fc.PlotAnnotation(point=steps[0], label="start")) steps.append(fc.PlotAnnotation(point=centre_point, label="centre")) fc.transform(steps, 'plot', fc.PlotControls(color_type='print_sequence', style='line')) ``` -------------------------------- ### Preview Design (Publication Style) Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/models/design_template.ipynb Create a publication-ready preview of the design with options for saving as a PNG. This offers a polished visualization for sharing. Uncomment to use. ```python # uncomment the next line to create a neat preview (click the top-left button in the plot for a .png file) - post and tag @FullControlXYZ :) # fc.transform(steps, 'plot', fc.PlotControls(neat_for_publishing=True, zoom=0.5, initialization_data={'extrusion_width': EW, 'extrusion_height': EH})) ``` -------------------------------- ### Import FullControl 5-Axis Libraries Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tutorials/lab_five_axis_demo.ipynb Imports necessary libraries for FullControl's 5-axis functionality. Ensure these are installed before running. ```python import lab.fullcontrol.fiveaxis as fc5 import fullcontrol as fc import lab.fullcontrol as fclab ``` -------------------------------- ### Set Initial Printer Speed and Temperature Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tutorials/colab/gcode_controls_colab.ipynb Configure initial print speed, travel speed, nozzle temperature, bed temperature, and fan speed. This is useful for setting up the printer environment before a print begins. ```python steps = [fc.Point(x=30, y=30, z=0.2), fc.Point(x=60)] initial_settings = { "print_speed": 2000, "travel_speed": 4000, "nozzle_temp": 280, "bed_temp": 80, "fan_percent": 40, } gcode_controls = fc.GcodeControls(initialization_data=initial_settings) print(fc.transform(steps, 'gcode', gcode_controls)) ``` -------------------------------- ### Import FullControl Libraries Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/models/nuts_and_bolts.ipynb Imports necessary modules from the FullControl library and its lab extension. Ensure these libraries are installed before running. ```python import fullcontrol as fc from math import tau import lab.fullcontrol as fclab ``` -------------------------------- ### Example Annotation Data Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tests/test_print_output_reference.txt Shows the format for defining annotations within plot data, including labels and their corresponding 3D coordinates. ```python plot_data.annotations = [{'label': 'extruder off', 'x': 65.0, 'y': 50.0, 'z': 4.5}, {'label': 'extruder on', 'x': 50.0, 'y': 50.0, 'z': 0.0}, {'label': 'finish', 'x': 50.0, 'y': 50.0, 'z': 5.0}, {'label': 'start', 'x': 70.0, 'y': 50.0, 'z': 0.0}] ``` -------------------------------- ### Configure Printer/G-code Parameters Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/models/anyangle_phone_stand.ipynb Sets up essential parameters for 3D printing, including temperatures, flow, speed, and fan settings. Select the appropriate printer profile from the available options. ```python # printer/gcode parameters design_name = 'anyangle_phone_stand' nozzle_temp = 210 bed_temp = 40 material_flow_percent = 100 print_speed_percent = 100 fan_percent = 100 printer_name='prusa_i3' # generic / ultimaker2plus / prusa_i3 / ender_3 / cr_10 / bambulab_x1 / toolchanger_T0 ``` -------------------------------- ### Import FullControl and Math Libraries Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/models/blob_printing.ipynb Initializes the FullControl library and imports the 'tau' constant from the math module for calculations involving circles and angles. ```python import fullcontrol as fc from math import tau ``` -------------------------------- ### G-code Generation Example 7 Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tests/test_print_output_reference.txt This G-code snippet demonstrates linear movements with relative extrusion, including a pause and a retraction command. ```gcode ; Time to print!!!!! ; GCode created with FullControl - tell us what you're printing! ; info@fullcontrol.xyz or tag FullControlXYZ on Twitter/Instagram/LinkedIn/Reddit/TikTok M83 ; relative extrusion G0 F8000 X0 Y0 Z0 G1 F1000 X20 E0.665203 G4 P2000 ; pause for 2 seconds G10 ; retract ``` -------------------------------- ### Transform Steps for Plotting Source: https://context7.com/fullcontrolxyz/fullcontrol/llms.txt Applies transformations to a list of steps for visualization. This example uses 'plot' style to render the path as a line. ```python fc.transform(steps, 'plot', fc.PlotControls(style='line')) ``` -------------------------------- ### Update Tutorial to Python Script Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tests/README.md Recreate the overall test script by converting modified tutorial notebooks into Python scripts. This ensures the test suite reflects the latest changes. ```bash cd bin python tutorials_to_py.py ``` -------------------------------- ### Create Steps List Using Python List Comprehension Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tutorials/colab/overview_colab.ipynb Efficiently creates a list of steps using Python's list comprehension for random point generation. Requires importing 'random'. ```python from random import random steps = [fc.Point(x=50*random(),y=50*random(),z=i*0.01) for i in range(1000)] fc.transform(steps, 'plot', fc.PlotControls(style='line')) ``` -------------------------------- ### Generate Polar Design for Plotting Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tutorials/colab/fast_demo_colab.ipynb Creates a design based on polar coordinates, suitable for plotting. This example generates a spiral pattern. ```python steps = [fc.polar_to_point(centre=fc.Point(x=0, y=0, z=i*0.005), radius=10, angle=i*4.321) for i in range(1000)] fc.transform(steps, 'plot', fc.PlotControls(neat_for_publishing=True, zoom=0.7)) ``` -------------------------------- ### Import FullControl 4-Axis Module Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tutorials/lab_four_axis_demo.ipynb Import the necessary module for 4-axis functionalities in FullControl. This is the initial setup for using 4-axis features. ```python import lab.fullcontrol.fouraxis as fc4 ``` -------------------------------- ### rectangleXY - Generate Rectangular Paths Source: https://context7.com/fullcontrolxyz/fullcontrol/llms.txt Generates a closed rectangular path. Define by starting corner, dimensions, and direction. Requires `fullcontrol` library. ```python import fullcontrol as fc steps = [] # Basic rectangle (counter-clockwise) start = fc.Point(x=0, y=0, z=0.2) rect_points = fc.rectangleXY( start_point=start, x_size=30, y_size=20, cw=False # Counter-clockwise (default) ) steps.extend(rect_points) ``` ```python # Clockwise rectangle at different position start2 = fc.Point(x=40, y=0, z=0.2) rect_cw = fc.rectangleXY( start_point=start2, x_size=25, y_size=15, cw=True # Clockwise direction ) steps.extend(rect_cw) ``` ```python # Stack multiple rectangles for a box for layer in range(5): z = 0.2 + layer * 0.2 steps.extend(fc.rectangleXY( start_point=fc.Point(x=0, y=40, z=z), x_size=20, y_size=20 )) ``` -------------------------------- ### Apply Built-in Primer Strategies Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tutorials/colab/gcode_controls_colab.ipynb Utilize predefined primer strategies like 'front_lines_then_xy' to prepare the print bed before the main design. This helps ensure a perfect first layer and minimizes defects. ```python steps = [fc.Point(x=30, y=30, z=0.2), fc.Point(x=60)] gcode_controls = fc.GcodeControls(initialization_data={"primer": "front_lines_then_xy"}) print(fc.transform(steps, 'gcode', gcode_controls)) ``` -------------------------------- ### G-code Generation Example 2 Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tests/test_print_output_reference.txt This G-code snippet shows a sequence of movements with relative extrusion. It includes comments indicating the purpose of the G-code. ```gcode ; Time to print!!!!! ; GCode created with FullControl - tell us what you're printing! ; info@fullcontrol.xyz or tag FullControlXYZ on Twitter/Instagram/LinkedIn/Reddit/TikTok M83 ; relative extrusion G0 F8000 X10 Y10 Z0 G1 F1000 X20 E0.332601 G1 X10 Y20 E0.470369 ``` -------------------------------- ### Preview Design with Plotting Controls Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/models/fractional_design_engine_polar.ipynb Provides a commented-out example for previewing the generated design using FullControl's plotting functionality. Hovering over the plot allows inspection of point coordinates. ```python # preview the design # fc.transform(steps, 'plot', fc.PlotControls(style='line')) # hover the cursor over the lines in the plot to check xyz positions of the points in the design ``` -------------------------------- ### Define Points for 3D Modeling Source: https://github.com/fullcontrolxyz/fullcontrol/blob/master/tests/test_print_output_reference.txt Example points with X, Y, Z coordinates and optional color, used for defining geometry in 3D space. ```python x=50.0 y=50.0 z=0.2 color=None ``` ```python x=50.0 y=60.0 z=0.2 color=None ``` ```python x=60.0 y=60.0 z=0.2 color=None ``` ```python x=60.0 y=50.0 z=0.2 color=None ```