Preserve installed operator workspace before consolidation
Local preservation snapshot, not a new deployment or simulation acceptance.
This commit is contained in:
@@ -0,0 +1,176 @@
|
||||
"""Photo-reconstructed Composit Muravey tread and visible wheel surfaces.
|
||||
|
||||
All units are metres. Does not reset/open/save the scene.
|
||||
|
||||
add_track(ctx): collection, materials {rubber, metal[, tread]},
|
||||
sample(s) -> (position, tangent, outward_normal), length=2.222,
|
||||
width=.220, pitch=.0505, side_label. The path is the belt NEUTRAL line.
|
||||
Position contains the global track Y centre; transverse offsets use global Y.
|
||||
Optional parameters: belt_thickness=.006, lug_height=.020, phase=0,
|
||||
direction=1, include_inner_lugs=True. Exact mould dimensions are NOT known.
|
||||
|
||||
add_wheel(ctx): collection, materials {rubber,metal[, painted]}, center,
|
||||
radius, width, side_label, kind='roller' or 'sprocket'. Rotation axis Y.
|
||||
A roller is one wheel; call twice for the two running lanes if required.
|
||||
Sprocket external diameter defaults to .160, independently of roller radius.
|
||||
Return a list of created objects. Parameters retain evidence-status properties.
|
||||
"""
|
||||
import math
|
||||
import bpy
|
||||
import bmesh
|
||||
from mathutils import Vector
|
||||
|
||||
|
||||
class Geometry:
|
||||
def __init__(self):
|
||||
self.vertices=[]
|
||||
self.faces=[]
|
||||
|
||||
def prism(self, lower, upper):
|
||||
"""Matching polygon rings, including concave chevron footprints."""
|
||||
n=len(lower); k=len(self.vertices)
|
||||
self.vertices.extend(lower); self.vertices.extend(upper)
|
||||
self.faces.append(tuple(k+i for i in reversed(range(n))))
|
||||
self.faces.append(tuple(k+n+i for i in range(n)))
|
||||
self.faces.extend((k+i,k+(i+1)%n,k+n+(i+1)%n,k+n+i) for i in range(n))
|
||||
|
||||
def loft(self, rings):
|
||||
n=len(rings[0]);k=len(self.vertices)
|
||||
for ring in rings:self.vertices.extend(ring)
|
||||
self.faces.append(tuple(k+i for i in reversed(range(n))))
|
||||
for j in range(len(rings)-1):
|
||||
self.faces.extend((k+j*n+i,k+j*n+(i+1)%n,
|
||||
k+(j+1)*n+(i+1)%n,k+(j+1)*n+i) for i in range(n))
|
||||
self.faces.append(tuple(k+(len(rings)-1)*n+i for i in range(n)))
|
||||
|
||||
def object(self, name, collection, material, bevel=0, smooth=False):
|
||||
mesh=bpy.data.meshes.new(name)
|
||||
mesh.from_pydata(self.vertices,[],self.faces);mesh.update()
|
||||
bm=bmesh.new();bm.from_mesh(mesh)
|
||||
bmesh.ops.recalc_face_normals(bm,faces=bm.faces)
|
||||
bm.to_mesh(mesh);bm.free()
|
||||
ob=bpy.data.objects.new(name,mesh);collection.objects.link(ob)
|
||||
if material:mesh.materials.append(material)
|
||||
if smooth:
|
||||
for p in mesh.polygons:p.use_smooth=True
|
||||
if bevel:
|
||||
mod=ob.modifiers.new('Mould edge radii — photo estimate','BEVEL')
|
||||
mod.width=bevel;mod.segments=2
|
||||
return ob
|
||||
|
||||
|
||||
def add_track(ctx):
|
||||
col=ctx['collection'];mats=ctx['materials'];sample=ctx['sample']
|
||||
length=ctx.get('length',2.222);width=ctx.get('width',.220)
|
||||
pitch=ctx.get('pitch',.0505);count=round(length/pitch)
|
||||
if abs(count*pitch-length)>.00001:
|
||||
raise ValueError('Track length must contain an integer number of nominal pitches')
|
||||
thick=ctx.get('belt_thickness',.006);height=ctx.get('lug_height',.020)
|
||||
phase=ctx.get('phase',0);direction=ctx.get('direction',1)
|
||||
prefix=ctx.get('side_label','TRACK')
|
||||
belt=Geometry();lugs=Geometry();ribs=Geometry();clips=Geometry();inner=Geometry()
|
||||
# Catalog frontal image: opening ~22 mm / 220 mm total width.
|
||||
half_window=.011;half_open_length=.015
|
||||
|
||||
def point(s,y,h):
|
||||
p,t,n=sample((s+phase)%length)
|
||||
return Vector(p)+Vector((0,y,0))+Vector(n)*h
|
||||
|
||||
def patch(g,s0,s1,y0,y1,h0,h1,steps=1):
|
||||
for j in range(steps):
|
||||
a=s0+(s1-s0)*j/steps;b=s0+(s1-s0)*(j+1)/steps
|
||||
p=[(a,y0),(b,y0),(b,y1),(a,y1)]
|
||||
g.prism([point(s,y,h0) for s,y in p],[point(s,y,h1) for s,y in p])
|
||||
|
||||
def footprint(g, s, coords, h0, h1, taper=.82):
|
||||
# coords in (transverse, longitudinal) axes. Top narrows slightly.
|
||||
cy=sum(p[0] for p in coords)/len(coords)
|
||||
cs=sum(p[1] for p in coords)/len(coords)
|
||||
low=[point(s+direction*d,y,h0) for y,d in coords]
|
||||
high=[point(s+direction*(cs+(d-cs)*taper),cy+(y-cy)*taper,h1) for y,d in coords]
|
||||
g.prism(low,high)
|
||||
|
||||
# Two continuous side bands. Central bridges leave genuine through-windows.
|
||||
for i in range(count):
|
||||
s=i*pitch
|
||||
for sign in (-1,1):
|
||||
a,b=sorted((sign*half_window,sign*width/2))
|
||||
patch(belt,s,s+pitch,a,b,-thick/2,thick/2,12)
|
||||
bridge=pitch/2-half_open_length
|
||||
patch(belt,s-bridge,s+bridge,-half_window,half_window,-thick/2,thick/2,6)
|
||||
|
||||
# Actual repeated pattern: TWO small chevrons per half and one diagonal
|
||||
# guide beside the window. No single oversized chevron across a half.
|
||||
for sign in (-1,1):
|
||||
for centre in (.050,.087):
|
||||
# Trace of sharp Muravey (v1) V footprint, mirrored across Y.
|
||||
p=[(centre-.016,-.012),(centre-.018,-.007),
|
||||
(centre-.004,.011),(centre,.014),
|
||||
(centre+.004,.011),(centre+.018,-.007),
|
||||
(centre+.016,-.012),(centre,.005)]
|
||||
p=[(sign*y,d) for y,d in p]
|
||||
if sign<0:p.reverse()
|
||||
footprint(lugs,s,p,thick/2-.0004,thick/2+height,.81)
|
||||
diag=[(.017,.013),(.023,.014),(.035,-.015),(.028,-.016)]
|
||||
diag=[(sign*y,d) for y,d in diag]
|
||||
if sign<0:diag.reverse()
|
||||
footprint(lugs,s,diag,thick/2-.0004,thick/2+height,.86)
|
||||
# Lower continuous shoulder behind the V row, and edge mould rail.
|
||||
a,b=sorted((sign*.014,sign*(width/2-.002)))
|
||||
patch(ribs,s-.005,s+.004,a,b,thick/2,thick/2+.0020,3)
|
||||
a,b=sorted((sign*(width/2-.008),sign*(width/2)))
|
||||
patch(ribs,s-.015,s+.035,a,b,thick/2,thick/2+.0013,12)
|
||||
# Fine grooves/ribs are visible between every pair of tread rows.
|
||||
a,b=sorted((sign*.015,sign*(width/2-.008)))
|
||||
for j in range(11):
|
||||
r=s+.016+j*.00185
|
||||
patch(ribs,r-.00034,r+.00034,a,b,thick/2,thick/2+.00065,1)
|
||||
|
||||
# One pressed metal U clip wraps EACH inter-window rubber bridge.
|
||||
# Width and bend radii are photo-derived; article110200149 not proved.
|
||||
clip_width=.026;clip_half=.0083;sheet=.00115
|
||||
# U in (longitudinal,normal) section, extruded across Y.
|
||||
profile=[(-clip_half-sheet,-thick/2-.001),
|
||||
(-clip_half-sheet,thick/2+.0005),
|
||||
(-clip_half,thick/2+.0020),
|
||||
(clip_half,thick/2+.0020),
|
||||
(clip_half+sheet,thick/2+.0005),
|
||||
(clip_half+sheet,-thick/2-.001),
|
||||
(clip_half,-thick/2-.001),
|
||||
(clip_half,thick/2+.0006),
|
||||
(-clip_half,thick/2+.0006),
|
||||
(-clip_half,-thick/2-.001)]
|
||||
clips.prism([point(s+ds,-clip_width/2,h) for ds,h in profile],
|
||||
[point(s+ds,clip_width/2,h) for ds,h in profile])
|
||||
|
||||
if ctx.get('include_inner_lugs',True):
|
||||
# Internal trapezoidal drive/guide bosses visible along bottom run.
|
||||
# Native IMG_2405 crop: height about 0.61 of the 50.5 mm pitch.
|
||||
# These tall guides were missing from the initial visual blockout.
|
||||
for sign in (-1,1):
|
||||
# Several shoulders capture the rounded narrow crown in the
|
||||
# photograph, rather than a rectangular truncated cube.
|
||||
h=ctx.get('inner_lug_height',.031);rings=[]
|
||||
for hh,ss,ww in [(0,.019,.019),(.32*h,.016,.0165),
|
||||
(.84*h,.008,.012), (h,.0045,.010)]:
|
||||
corners=[(sign*(.033-ww),-ss),(sign*(.033+ww),-ss),
|
||||
(sign*(.033+ww),ss),(sign*(.033-ww),ss)]
|
||||
if sign<0:corners.reverse()
|
||||
rings.append([point(s+ds,y,-thick/2-hh) for y,ds in corners])
|
||||
inner.loft(rings)
|
||||
result=[]
|
||||
specs=[(belt,'continuous perforated rubber carcass',mats['rubber'],0),
|
||||
(lugs,'44 rows • four small V lugs and two centre diagonals',mats.get('tread',mats['rubber']),.00065),
|
||||
(ribs,'fine transverse mould ribs and edge rails',mats.get('tread',mats['rubber']),0),
|
||||
(clips,'44 pressed inter-window clips',mats['metal'],.00025),
|
||||
(inner,'inner guide bosses • photo estimate',mats['rubber'],.0012)]
|
||||
for geom,label,mat,bev in specs:
|
||||
ob=geom.object(prefix+' | '+label,col,mat,bev)
|
||||
ob['source']='Composit Muravey catalog frontal image; DCD-006 IMG_2407 / IMG_2405'
|
||||
ob['nominal_width_mm']=width*1000;ob['nominal_length_mm']=length*1000
|
||||
ob['nominal_pitch_mm']=pitch*1000;ob['pitch_count']=count
|
||||
ob['nominal_lug_height_mm']=height*1000
|
||||
ob['geometry_status']='Mould and clip contours photo reconstructed; not toleranced production geometry'
|
||||
result.append(ob)
|
||||
return result
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
"""Static taut belt solve. Metres; catalog neutral-length convention assumed."""
|
||||
import math
|
||||
from mathutils import Vector
|
||||
RW=.0625;THICK=.006;PITCH=.0505;LENGTH=2.222
|
||||
WHEELS={'rear_upper':(-.17025461,.32363473),'drive':(.40182697,.22413776),'front_lower':(.31115497,.0885),'rear_lower':(-.410,.0885),'middle_lower':(-.002609266,.0885)}
|
||||
ORDER=['rear_upper','drive','front_lower','rear_lower']
|
||||
RADII=[RW+THICK/2,PITCH/(2*math.sin(math.pi/9)),RW+THICK/2,RW+THICK/2]
|
||||
def segments(wheels):
|
||||
cc=[wheels[k]for k in ORDER];ns=[]
|
||||
for i in range(4):
|
||||
j=(i+1)%4;dx=cc[j][0]-cc[i][0];dz=cc[j][1]-cc[i][1];d=math.hypot(dx,dz);ux,uz=dx/d,dz/d;k=(RADII[i]-RADII[j])/d
|
||||
ns.append((ux*k-uz*math.sqrt(1-k*k),uz*k+ux*math.sqrt(1-k*k)))
|
||||
seg=[];total=0
|
||||
for i,(x,z)in enumerate(cc):
|
||||
r=RADII[i];n0=ns[(i-1)%4];n1=ns[i];a0=math.atan2(n0[1],n0[0]);a1=math.atan2(n1[1],n1[0])
|
||||
while a1>=a0:a1-=2*math.pi
|
||||
ln=(a0-a1)*r;seg.append(('arc',total,ln,(x,z,r,a0)));total+=ln
|
||||
j=(i+1)%4;p=(x+r*n1[0],z+r*n1[1]);q=(cc[j][0]+RADII[j]*n1[0],cc[j][1]+RADII[j]*n1[1]);ln=math.dist(p,q)
|
||||
seg.append(('line',total,ln,(*p,(q[0]-p[0])/ln,(q[1]-p[1])/ln,*n1)));total+=ln
|
||||
return total,seg
|
||||
|
||||
def solve():
|
||||
w=dict(WHEELS)
|
||||
p=(-.03196350872,.26637459865);q=w['rear_upper'];d=math.dist(p,q)
|
||||
w['rear_upper']=tuple(p[i]+(q[i]-p[i])*.145/d for i in range(2))
|
||||
lo,hi=-.55,-.32
|
||||
for _ in range(70):
|
||||
mid=(lo+hi)/2;w['rear_lower']=(mid,.0885)
|
||||
if segments(w)[0]>LENGTH:lo=mid
|
||||
else:hi=mid
|
||||
w['rear_lower']=((lo+hi)/2,.0885);length,seg=segments(w)
|
||||
def sample(s,y=0):
|
||||
s=s%length
|
||||
for kind,start,ln,d in seg:
|
||||
if s<=start+ln+1e-10:
|
||||
t=s-start
|
||||
if kind=='arc':
|
||||
x,z,r,a=d;a-=t/r;n=Vector((math.cos(a),0,math.sin(a)));tangent=Vector((math.sin(a),0,-math.cos(a)));p=Vector((x,y,z))+r*n
|
||||
else:
|
||||
x,z,tx,tz,nx,nz=d;p=Vector((x+tx*t,y,z+tz*t));n=Vector((nx,0,nz));tangent=Vector((tx,0,tz))
|
||||
return p,tangent,n
|
||||
# Put the centre of one window at the drive arc midpoint. Align one tooth there.
|
||||
drive=seg[2];mid_s=drive[1]+drive[2]/2;phase=(mid_s-PITCH/2)%PITCH
|
||||
a=drive[3][3]-drive[2]/(2*drive[3][2])
|
||||
return dict(wheels=w,length=length,segments=seg,sample=sample,track_phase=phase,sprocket_phase=a,neutral_radii=RADII)
|
||||
Reference in New Issue
Block a user