コード例 #1
0
ファイル: geom1.py プロジェクト: FrankNaets/pyNastran
 def _read_cord1c(self, data, n):
     """
     (1701,17,6) - the marker for Record 1
     """
     s = Struct(b(self._endian + '6i'))
     nentries = (len(data) - n) // 24
     for i in range(nentries):
         edata = data[n:n + 24]  # 6*4
         out = s.unpack(edata)
         (cid, one, two, g1, g2, g3) = out
         assert one in [1, 2], one
         assert two in [1, 2], two
         if self.is_debug_file:
             self.binary_debug.write('  CORD1C=%s\n' % str(out))
         data_in = [cid, g1, g2, g3]
         coord = CORD1C.add_op2_data(data_in)
         self.add_coord(coord)
         n += 24
     self._increase_card_count('CORD1C', nentries)
     return n
コード例 #2
0
 def _read_cord1c(self, data, n):
     """
     (1701,17,6) - the marker for Record 1
     """
     struct_6i = Struct(self._endian + b'6i')
     nentries = (len(data) - n) // 24
     for i in range(nentries):
         edata = data[n:n + 24]  # 6*4
         out = struct_6i.unpack(edata)
         (cid, one, two, g1, g2, g3) = out
         assert one in [1, 2], one
         assert two in [1, 2], two
         if self.is_debug_file:
             self.binary_debug.write('  CORD1C=%s\n' % str(out))
         data_in = [cid, g1, g2, g3]
         coord = CORD1C.add_op2_data(data_in)
         self._add_coord_object(coord)
         n += 24
     self.increase_card_count('CORD1C', nentries)
     return n
コード例 #3
0
 def _read_cord1c(self, data: bytes, n: int) -> int:
     """
     (1701,17,6) - the marker for Record 1
     """
     ntotal = 24 * self.factor  # 6*4
     struct_6i = Struct(mapfmt(self._endian + b'6i', self.size))
     nentries = (len(data) - n) // ntotal
     for unused_i in range(nentries):
         edata = data[n:n + ntotal]
         out = struct_6i.unpack(edata)
         (cid, one, two, g1, g2, g3) = out
         assert one in [1, 2], one
         assert two in [1, 2], two
         if self.is_debug_file:
             self.binary_debug.write('  CORD1C=%s\n' % str(out))
         data_in = [cid, g1, g2, g3]
         coord = CORD1C.add_op2_data(data_in)
         self._add_coord_object(coord)
         n += ntotal
     self.increase_card_count('CORD1C', nentries)
     return n