Git Product home page Git Product logo

pclwriter's Introduction

pclwriter

Generating pcl file for Patran in Node.js (v 4.3.0)

Examples

//
//  Modules 
var PCLParser = require( '../build/Release/pclwriter' ); 
 
//  Global Variables
//
var theParser = new PCLParser.YPCLWriter();
var SVGLine = 'M 202.637 108.597 L 201.448 105.483 A 2.29999 2.29999 0 0 0 199.388 104.006';

theParser.setSectionPCLCommandMap("Loftcurve", "sgm_const_curve_loft" );
theParser.setSectionPCLCommandMap("Arc2", "sgm_const_curve_2d_arc2point_v2" );
theParser.setSectionPCLCommandMap("2CurSur", 'asm_const_surface_2curve');


theParser.setSectionPCLCommandMap("Grid", 'asm_const_grid_xyz');
theParser.setSectionPCLCommandMap("Line", 'asm_const_line_2point');

theParser.setPCLCommandFilePath('../msc/pclcom.txt');
theParser.setOutputFilePath('./section.ses');
  
theParser.write('STRING s_output_ids[VIRTUAL]\n');
theParser.setBaseCenter([10.1, 12.2, 10.0]);
theParser.setCoordPlaneID(2)

theParser.writeSesFileHeader();

var result = theParser.parserSVGLine( SVGLine );

console.log( result );

function test()
{
    var commandName = 'asm_const_grid_xyz'    
	var paraList = [];
	paraList.push( '\"#\"' );
	paraList.push( '\"[200, 100, 118 ]\"' );
	paraList.push( '\"Coord 0\"' );
	paraList.push( 's_output_ids' );

	theParser.writePCL( commandName, paraList ); 				
}

//
//  Loading and Constraints
function load()
{
    var command = 'loadsbcs_create2'    
	var paraList = [];
    
    var loadName = '\"Disp_1\"'
    var loadType = '\"Displacement\"';
 
	paraList.push( loadName );
	paraList.push( loadType );
	paraList.push( '\"Nodal\"' );
	paraList.push( '\" \"' );
	paraList.push( '\"Static\"' );
	paraList.push( '[\"Node 10001 10002\"]' );
	paraList.push( '\"FEM\"' );
	paraList.push( '\"Coord 0\"' );
	paraList.push( '\"1.0\"' );
	paraList.push( ' [\"<0 0 0>\", \"<0 0 0>\", \"< >\", \"< >\"]' );
	paraList.push( '[\"\", \"\", \"\", \"\"]' );

	theParser.writePCL( command, paraList );

    paraList = [];  

    loadName = '\"F_1\"';
    loadType = '\"Force\"';

	paraList.push( loadName );
	paraList.push( loadType );
	paraList.push( '\"Nodal\"' );
	paraList.push( '\" \"' );
	paraList.push( '\"Static\"' );
	paraList.push( '[\"Node 10003\"]' );
	paraList.push( '\"FEM\"' );
	paraList.push( '\"Coord 0\"' );
	paraList.push( '\"1.0\"' );
	paraList.push( ' [\"<0 0   0 >\", \"<1000 0 0>\", \"< >\", \"< >\"]' );
	paraList.push( '[\"\", \"\", \"\", \"\"]' );

	theParser.writePCL( command, paraList );
}

test();
load();

#License

pclwriter 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 3 of the License, or (at your option) any later version.

pclwriter is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with pclwriter. If not, see http://www.gnu.org/licenses/.

pclwriter's People

Contributors

cocoon-yang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.