Git Product home page Git Product logo

objectivec-stl-parser's Introduction

ObjectiveC-STL-Parser

Objective C Parser for STL Files.

  1. Add the following files to your project. STLParser.h STLParser.m STLParser.ym STLPrimitives.h STLTokenizer.lm

  2. To parse the stl file call the parseFileWithFilePath method of STLParser class. To receive parsed data/syntax error exception your class should be a delegate of STLParser class. To achieve this you can use STLParserDelegate protocol and then you should add your instance to the parserDelegate observer array as in (B). Now in a background thread you may call the parseFileWithFilePath on the parser instance with the full path of the stl file as argument.

    Sample usage : STLParser *parser=[[STLParser alloc] init]; //Allocates the parser

    [parser addParseDelegate:self]; // (B)

    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, (unsigned long)NULL), ^(void) { [parser parseFileWithFilePath:path]; });

  3. Once the parsing is successful you will get a callback on (void) notifyParseSuccess:(STLData *) parsedData method and when the parsing fails you will get a callback on (void) notifyParseFailure:(NSString *) exceptionData. Be aware that when the parse succeeds you will get a parsedData reference. This is allocated in the heap. Do a free(parsedData) call whenever you are done with that data.

  4. Make sure you release the parser instance of STLParser class in the dealloc method.

objectivec-stl-parser's People

Contributors

dgkris avatar

Watchers

Manu Mohan A avatar James Cloos 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.