<commit_before># -*- coding:utf-8 -*- 

# ***************************************************************************
#                                  Vrml.py
#                             -------------------
#    update               : 2013-11-19
#    copyright            : (C) 2013 by <NAME>
#    email                : <EMAIL>
# ***************************************************************************

# ***************************************************************************
# *                                                                         *
# *   This program is free software; you can redistribute it and/or modify  *
# *   it under the terms of the GNU General Public License as published by  *
# *   the Free Software Foundation; either version 2 of the License, or     *
# *   (at your option) any later version.                                   *
# *                                                                         *
# ***************************************************************************


#-
#
# External dependencies
#
#
#-
from numpy import array
from .Mesh import Mesh







#--
#
# ReadVrml
#
#--
#
# Import mesh from a file in Inventor / VRML / X3D format
#
def ReadVrml( filename ) :

	# Initialisation
	vertices = []
	faces = []
	normals = []
	colors = []
	texcoords = []
        material = ''
	nlbrack = 0
	nrbrack = 0
	level = 0
	ixyz = 0
	nodes = [ '' ]
	vec2d = [ 0.0, 0.0 ]
	vec3d = [ 0.0, 0.0, 0.0 ]
	vec3i = [ 0, 0, 0 ]
	previous_word = ''
	color_binding = ''
	normal_binding = ''

	# Open the file
	vrmlfile = open( filename, 'r' )

	# Check the header
	header = vrmlfile.readline().split()
	if header[0] not in [ '#VRML', '#X3D', '#Inventor' ] :

		vrmlfile.close()
		raise RuntimeError( 'Wrong file format !' )

	# Read each line in the file
	for line in vrmlfile :

		# Empty line
		if line.isspace() : continue

		# Comment
		if line.startswith( '#' ) : continue

		# Remove comma
		line = line.replace( ',', ' ' )

		# Add buffer space around brackets and braces<commit_msg>Correct a bug with unicode in filename.<commit_after># -*- coding:utf-8 -*- 

# ***************************************************************************
#                                  Vrml.py
#                             -------------------
#    update               : 2013-11-22
#    copyright            : (C) 2013 by <NAME>
#    email                : <EMAIL>
# ***************************************************************************

# ***************************************************************************
# *                                                                         *
# *   This program is free software; you can redistribute it and/or modify  *
# *   it under the terms of the GNU General Public License as published by  *
# *   the Free Software Foundation; either version 2 of the License, or     *
# *   (at your option) any later version.                                   *
# *                                                                         *
# ***************************************************************************


#-
#
# External dependencies
#
#
#-
from numpy import array
from .Mesh import Mesh







#--
#
# ReadVrml
#
#--
#
# Import mesh from a file in Inventor / VRML / X3D format
#
def ReadVrml( filename ) :

	# Initialisation
	vertices = []
	faces = []
	normals = []
	colors = []
	texcoords = []
        material = ''
	nlbrack = 0
	nrbrack = 0
	level = 0
	ixyz = 0
	nodes = [ '' ]
	vec2d = [ 0.0, 0.0 ]
	vec3d = [ 0.0, 0.0, 0.0 ]
	vec3i = [ 0, 0, 0 ]
	previous_word = ''
	color_binding = ''
	normal_binding = ''

	# Open the file
	vrmlfile = open( unicode(filename), 'r' )

	# Check the header
	header = vrmlfile.readline().split()
	if header[0] not in [ '#VRML', '#X3D', '#Inventor' ] :

		vrmlfile.close()
		raise RuntimeError( 'Wrong file format !' )

	# Read each line in the file
	for line in vrmlfile :

		# Empty line
		if line.isspace() : continue

		# Comment
		if line.startswith( '#' ) : continue

		# Remove comma
		line = line.replace( ',', ' ' )

		# Add buffer space around brackets and braces
{'fraction_non_alphanumeric': 0.2553965559058938, 'fraction_numerical': 0.017948096046568034, 'mean_word_length': 1.9331436699857754, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3335435', 'n_tokens_mistral': 1274, 'n_tokens_neox': 1124, 'n_words': 329}