Skip to content

Commit

Permalink
fix overwriting
Browse files Browse the repository at this point in the history
  • Loading branch information
YuXHe15 committed Aug 30, 2023
1 parent 6ee33d6 commit fe2389e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion amworkflow/src/geometries/composite_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ def Shape(self):
def create_sides(self):
if self.R is not None:
self.pts = polygon_interpolater(self.pts, self.interpolate)
bender(self.pts, self.R)
self.pts = bender(self.pts, self.R)
self.pts = [i for i in self.pts]
self.th *= 0.5
for i,p in enumerate(self.pts):
Expand Down
1 change: 1 addition & 0 deletions amworkflow/src/geometries/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ def bender(point_cordinates, radius: float = None, mx_pt: np.ndarray = None, mn_
thetp = lp / (Rp)
pt[0] = Rp * np.sin(thetp)
pt[1] = o_y - Rp*np.cos(thetp)
return point_cordinates

def array_project(array: np.ndarray, direct: np.ndarray) -> np.ndarray:
'''
Expand Down
6 changes: 3 additions & 3 deletions examples/pwall/pwall.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ def geometry_spawn(pm):
put1 = g.p_translate(pu, [3 * l, 0, 0]) # Translate the unit _/-\_/-\
end_p = np.copy(put1[-1])
end_p[0] += l * 0.5 # Add one point to make half of the infill _/-\_/-\_
pm = pu + put1 # integrate the points together
pm.append(end_p) # add the point
p_up = pu + put1 # integrate the points together
p_up.append(end_p) # add the point
# pm_cnt = g.p_center_of_mass(pm)
# pm_cnt[0] -=hth
pmr = g.p_rotate(pm, angle_z=np.pi) # Rotate the half infill to make it upside down
pmr = g.p_rotate(p_up, angle_z=np.pi) # Rotate the half infill to make it upside down
# pmr = g.p_translate(pmr, np.array([-th,0,0]))
cnt2 = g.p_center_of_mass(pmr) #Get the center of mass of all points
t_len = cnt2[1] * 2 #2 times the y coord would be the length for translation
Expand Down

0 comments on commit fe2389e

Please sign in to comment.