সমললৈ যাওক

চিত্ৰ:Diamond lattice.stl

এই পৃষ্ঠাৰ সমল অন্য ভাষাত সমৰ্থিত নহয়।
অসমীয়া ৱিকিপিডিয়াৰ পৰা

মূল ফাইল (5,120 × 2,880 পিক্সেল, ফাইলৰ মাত্ৰা: 181 KB, MIME প্ৰকাৰ: application/sla)

এই ফাইলটো ৱিকিমিডিয়া কমন্সৰ পৰা আমদানি কৰা হৈছে। ফাইল বিৱৰণ পৃষ্ঠাৰ সবিশেষ তথ্য তলত উল্লেখ কৰা হ’ল ।
ৱিকিমিডিয়া কমন্স এটা মুক্ত অনুজ্ঞাপত্ৰ মিডিয়াৰ ভঁৰাল। আপুনিও ইচ্ছা কৰিলে এই প্ৰকল্পত সহায় কৰিব পাৰে

View Diamond lattice.stl  on viewstl.com

সাৰাংশ

বিৱৰণ
English: A model of a diamond lattice comprising 2 x 2 x 2 unit cells by CMG Lee. Atoms are represented by tetrakis cuboctahedrons and bonds by triangular antiprisms.
তাৰিখ
উৎস নিজা কাৰ্য
লেখক Cmglee
#!/usr/bin/env python

header = 'A model of a diamond lattice comprising 2 x 2 x 2 unit cells by CMG Lee.'

import re, struct, math
def fmt(string): ## string.format(**vars()) using tags {expression!format} by CMG Lee
 def f(tag): i_sep = tag.rfind('!'); return (re.sub('\.0+$', '', str(eval(tag[1:-1])))
  if (i_sep < 0) else ('{:%s}' % tag[i_sep + 1:-1]).format(eval(tag[1:i_sep])))
 return (re.sub(r'(?<!{){[^{}]+}', lambda m:f(m.group()), string)
         .replace('{{', '{').replace('}}', '}'))
def append(obj, string): return obj.append(fmt(string))
def tabbify(cellss, separator='|'):
 cellpadss = [list(rows) + [''] * (len(max(cellss, key=len)) - len(rows)) for rows in cellss]
 fmts = ['%%%ds' % (max([len(str(cell)) for cell in cols])) for cols in zip(*cellpadss)]
 return '\n'.join([separator.join(fmts) % tuple(rows) for rows in cellpadss])
def hex_rgb(colour): ## convert [#]RGB to #RRGGBB and [#]RRGGBB to #RRGGBB
 return '#%s' % (colour if len(colour) > 4 else ''.join([c * 2 for c in colour])).lstrip('#')
def viscam_colour(colour):
 colour_hex      = hex_rgb(colour)
 colour_top5bits = [int(colour_hex[i:i+2], 16) >> 3 for i in range(1,7,2)]
 return (1 << 15) + (colour_top5bits[0] << 10) + (colour_top5bits[1] << 5) + colour_top5bits[2]
def roundm(x, multiple=1):
 if   (isinstance(x, tuple)): return tuple(roundm(list(x), multiple))
 elif (isinstance(x, list )): return [roundm(x_i, multiple) for x_i in x]
 else: return int(math.floor(float(x) / multiple + 0.5)) * multiple
def rotate(facetss, deg_x, deg_y, deg_z): ## around x then y then z axes
 (sin_x, cos_x) = (math.sin(math.radians(deg_x)), math.cos(math.radians(deg_x)))
 (sin_y, cos_y) = (math.sin(math.radians(deg_y)), math.cos(math.radians(deg_y)))
 (sin_z, cos_z) = (math.sin(math.radians(deg_z)), math.cos(math.radians(deg_z)))
 facet_rotatess = []
 for facets in facetss:
  facet_rotates = []
  for i_point in range(4):
   (x, y, z) = [facets[3 * i_point + i_xyz] for i_xyz in range(3)]
   if (x is None or y is None or z is None):
    facet_rotates += [x, y, z]
   else:
    (y, z) = (y * cos_x - z * sin_x,  y * sin_x + z * cos_x) ## rotate about x
    (x, z) = (x * cos_y + z * sin_y, -x * sin_y + z * cos_y) ## rotate about y
    (x, y) = (x * cos_z - y * sin_z,  x * sin_z + y * cos_z) ## rotate about z
    facet_rotates += [round(value, 9) for value in [x, y, z]]
  facet_rotatess.append(facet_rotates)
 return facet_rotatess
def translate(facetss, dx, dy, dz):
 ds = [dx, dy, dz]
 return [facets[:3] + [facets[3 * i_point + i_xyz] + ds[i_xyz]
                       for i_point in range(1,4) for i_xyz in range(3)]
         for facets in facetss]

## Add facets
facet_stickss          = [[None,0,0,  -2,10,10, -40,40,48, -10, 2,10],
                          [None,0,0, -10, 2,10, -48,40,40, -10,10, 2],
                          [None,0,0, -10,10, 2, -40,48,40,  -2,10,10]]
facet_stickss         += translate(rotate(translate(facet_stickss, 25,-25,-25),
                                          90,-90,90), -25,25,25)
facet_stickss         += rotate(facet_stickss,  0,  0,180)
facet_stickss         += rotate(facet_stickss,  0,180,  0)
facet_ball_triangless  = [[None,0,0, 12,12,0, 0,12,12, 12,0,12]]
facet_ball_triangless += rotate(facet_ball_triangless   ,  90,  0, 0)
facet_ball_triangless += rotate(facet_ball_triangless   , 180,  0, 0)
facet_ball_triangless += rotate(facet_ball_triangless   ,   0,180, 0)
facet_ball_diamondss   = [[None,0,0, 17,0,0, 12,12,0, 12,0,12]]
facet_ball_diamondss  += rotate(facet_ball_diamondss    , 180,  0, 0)
facet_ball_diamondss  += rotate(facet_ball_diamondss    ,  90,  0, 0)
facet_ball_diamondss  += rotate(facet_ball_diamondss    ,   0,180, 0)
facet_ball_diamondss  += rotate(facet_ball_diamondss    ,   0, 90, 0)
facet_ball_diamondss  += rotate(facet_ball_diamondss[:8],   0,  0,90)
facet_ballss           = facet_ball_diamondss + facet_ball_triangless
facet_stick_ballss     = facet_stickss + facet_ballss

facet_cell_1ss  = (translate(facet_ballss,100,100,0)
                 + translate(facet_stick_ballss, 50,50,50))
facet_cell_1ss += translate(facet_cell_1ss, 100,100,0)
facet_cell_2ss  = (translate(facet_ballss,200,100,100)
                 + translate(facet_stick_ballss, 150,50,150))
facet_cell_2ss += translate(facet_cell_2ss, -100,100,0)
facet_cellss    = facet_cell_1ss + facet_cell_2ss

facetss  = facet_cellss
facetss += translate(facetss, 200,  0,  0)
facetss += translate(facetss,   0,200,  0)
facetss += translate(facetss,   0,  0,200)
facetss += (facet_ballss
           + translate(facet_ballss,   0,200,  0)
           + translate(facet_ballss,   0,100,100)
           + translate(facet_ballss,   0,300,100)
           + translate(facet_ballss,   0,  0,200)
           + translate(facet_ballss,   0,200,200)
           + translate(facet_ballss,   0,400,200)
           + translate(facet_ballss,   0,100,300)
           + translate(facet_ballss,   0,300,300)
           + translate(facet_ballss,   0,200,400)
           + translate(facet_ballss,   0,400,400)
           + translate(facet_ballss, 200,  0,  0)
           + translate(facet_ballss, 100,  0,100)
           + translate(facet_ballss, 300,  0,100)
           + translate(facet_ballss,   0,  0,200)
           + translate(facet_ballss, 200,  0,200)
           + translate(facet_ballss, 400,  0,200)
           + translate(facet_ballss, 100,  0,300)
           + translate(facet_ballss, 300,  0,300)
           + translate(facet_ballss, 200,  0,400)
           + translate(facet_ballss, 400,  0,400)
           + translate(facet_ballss, 100,100,400)
           + translate(facet_ballss, 100,300,400)
           + translate(facet_ballss, 200,200,400)
           + translate(facet_ballss, 300,100,400)
           + translate(facet_ballss, 400,200,400)
           + translate(facet_ballss, 300,300,400)
           + translate(facet_ballss, 200,400,400)
           )

## Calculate normals
for facets in facetss:
 if (facets[0] is None or facets[1] is None or facets[2] is None):
  us      = [facets[i_xyz + 9] - facets[i_xyz + 6] for i_xyz in range(3)]
  vs      = [facets[i_xyz + 6] - facets[i_xyz + 3] for i_xyz in range(3)]
  normals = [us[1]*vs[2] - us[2]*vs[1], us[2]*vs[0] - us[0]*vs[2], us[0]*vs[1] - us[1]*vs[0]]
  normal_length = sum([component * component for component in normals]) ** 0.5
  facets[:3] = [round(component / normal_length, 10) for component in normals]

# print(tabbify([['%s%d' % (xyz, n) for n in range(3) for xyz in list('XYZ')] +
#                ['N%s'  % (xyz) for xyz in list('xyz')] + ['s0f']] + facetss))
## Compile STL
outss = ([['STL\n\n%-73s\n\n' % (header[:73]), struct.pack('<L', len(facetss))]] +
         [[struct.pack('<f', float(value)) for value in facets[:12]] +
          [struct.pack('<H', 0 if (len(facets) <= 12) else
                             viscam_colour(facets[12]))] for facets in facetss])
out   = ''.join([out for outs in outss for out in outs])
print('# bytes:%d\t# facets:%d\ttitle: %s' % (len(out), len(facetss), header[:73]))
with open(__file__[:__file__.rfind('.')] + '.stl', 'wb') as f_out: f_out.write(out)
 # f_out.write('%s\n## Python script to generate STL\n%s\n' % (''.join(outs), open(__file__).read()))

অনুজ্ঞাপত্ৰ

ম‍ই, এই কামৰ স্বত্বাধিকাৰী, ইয়াৰ দ্বাৰা ম‍ই এই কামক তলত বৰ্ননা দিয়া অনুজ্ঞাপত্ৰৰ অধীনত প্ৰকাশ কৰিলো:
w:en:Creative Commons
স্বীকৃতিপ্ৰদান একে ধৰণে চেয়াৰ কৰক
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
আপুনি স্বাধীনভাৱে:
  • বিতৰণ কৰিব পাৰে – কামটো নকল (কপি), বিতৰণ আৰু প্ৰেৰণ কৰিবলৈ
  • পুনৰ্মিশ্ৰণ কৰিবলৈ – কামটো অভিযোজন কৰিবলৈ
তলত উল্লেখ কৰা চৰ্ত্তসমূহৰ ভিত্তিত:
  • স্বীকৃতিপ্ৰদান – আপুনি প্ৰয়োজনীয় স্বীকৃতি দিয়াৰ লগতে অনুজ্ঞাপত্ৰলৈ লিংক আৰু কোনো সালসলনিৰ ইংগিত দিব লাগিব। আপুনি এয়া উপযুক্ত ধৰণেৰে দিব পাৰে, মাত্ৰ অনুজ্ঞাপত্ৰধাৰীয়ে আপোনাক বা আপোনাৰ কামক মঞ্জুৰী জনোৱাৰ দৰে নিলিখিব।
  • একে ধৰণে চেয়াৰ কৰক – যদি আপুনি এই কামটো পৰিবৰ্তন, ৰূপান্তৰ বা এই কামটোৰ উপৰত ভিত্তি কৰি নতুন সৃষ্টিকৰ্ম তৈয়াৰ কৰে, আপুনি শেষৰ কৰ্মটো পূৰ্বৰ কৰ্মটোৰ সৈতে একে বা একেধৰণৰ অনুজ্ঞাপত্ৰৰ আওতাত বিতৰণ কৰিব পাৰে।
Wikimedia Foundation
The uploader of this file has agreed to the Wikimedia Foundation 3D patent license: This file and any 3D objects depicted in the file are both my own work. I hereby grant to each user, maker, or distributor of the object depicted in the file a worldwide, royalty-free, fully-paid-up, nonexclusive, irrevocable and perpetual license at no additional cost under any patent or patent application I own now or in the future, to make, have made, use, offer to sell, sell, import, and distribute this file and any 3D objects depicted in the file that would otherwise infringe any claims of any patents I hold now or in the future.

Please note that in the event of any differences in meaning or interpretation between the original English version of this license and a translation, the original English version takes precedence.

কেপ্‌চন

এই ফাইলে কি প্ৰতিনিধিত্ব কৰে তাৰ এটা শাৰীত ব্যাখ্যা কৰক

Items portrayed in this file

depicts ইংৰাজী

copyright status ইংৰাজী

copyrighted ইংৰাজী

inception ইংৰাজী

১৮ মাৰ্চ 2018

source of file ইংৰাজী

original creation by uploader ইংৰাজী

ফাইলৰ ইতিবৃত্ত

ফাইলৰ আগৰ অৱস্থা চাবলৈ সেই তাৰিখ/সময়ত ক্লিক কৰক।

তাৰিখ/সময়ক্ষুদ্ৰ প্ৰতিকৃতিআকাৰসদস্যমন্তব্য
বৰ্তমান00:14, 19 March 201800:14, 19 March 2018ৰ সংস্কৰণৰ ক্ষুদ্ৰ প্ৰতিকৃতি5,120 × 2,880 (181 KB)CmgleeUser created page with UploadWizard

তলত দিয়া 2 পৃষ্ঠাবোৰে এই ফাইলটো ব্যৱহাৰ কৰে:

ফাইলৰ গোলকীয় ব্যৱহাৰ

তলত দিয়া আন ৱিকিসমূহে এই ফাইলটো ব্যৱহাৰ কৰে: