Skip to content

Can you help me desing an overhang test for 5 axis printer? #77

Description

@qlqlo

I want to create an overhang test for my 5 axis printer, but I struggle with python and math. I wrote a code in which I did not care about the rotation of the nozzle and I already got stuck. I was able to write a code that makes the base geometry, but when I skip to next segment there is a big gap and I don't know how to fix it. Can you please guide me through this problem?

extrusion_width = 2
extrusion_height = 1                    # and layer height
initial_z = extrusion_height*0.6           # for squish of the 1st layer

x_size = 40
y_size = 20
start_point = fc.Point(x=0, y=0, z=initial_z)
segment_length = 50
angle_between_segments = 10 # degrees


x0, y0 = 0,0
x1, y1 = x_size,y0
x2, y2 = x1,y1+y_size
x3, y3 = x0,y2

steps = []

angle_in_radians = math.radians(angle_between_segments)
z_offset = - segment_length
y_offset = 0


for segment in range(10):
  y_offset = y_offset + segment_length * math.sin(angle_in_radians)
  z_offset = z_offset + segment_length * math.cos(angle_in_radians)

  angle = segment * angle_between_segments
  angle_in_radians = math.radians(angle)

  z_move = math.cos(angle_in_radians)
  y_move = math.sin(angle_in_radians)

  z_correction = y_size * math.sin(angle_in_radians)
  y_correction = 0
  y_correction = y_size * math.cos(angle_in_radians)

  print(y_offset)

  for layer in range (50):
    point0 = fc.Point(x=x0, y=y0 - layer*y_move - y_offset, z=initial_z + extrusion_height*layer*z_move + z_offset)
    point1 = fc.Point(x=x1, y=y1 - layer*y_move - y_offset, z=initial_z + extrusion_height*layer*z_move + z_offset)
    point2 = fc.Point(x=x2, y=y0 - layer*y_move - y_offset + y_correction, z=initial_z + extrusion_height*layer*z_move + z_offset + z_correction)
    point3 = fc.Point(x=x3, y=y0 - layer*y_move - y_offset + y_correction, z=initial_z + extrusion_height*layer*z_move + z_offset + z_correction)
    steps.append(point0)
    steps.append(point1)
    steps.append(point2)
    steps.append(point3)


fc.transform(steps, 'plot', fc.PlotControls(color_type='print_sequence', style='line'))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions