Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 42

Thread: instant teapot

  1. #16
    Member
    Join Date
    Oct 2003
    Location
    Near Edinburgh
    Posts
    246
    Jeric, the points and polygon information was hard coded in the file. The function to create the teapot just looped through the arrays and added points and polygons to modeler. The original data that I used to create the c plugins came from the datasets for the Utah teapot that I found online. The lscript file I used the data supplied with the sdk for 11.

    You need to cater for tris and quads and possibly ngons so you would need to test for the number of points to issue the correct number of addpoints before the addpolygon command.

    Regards
    Iain

  2. #17
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,741
    No worries: I figure the scanner portion would just duplicate each poly, brute force.

    The reconstruction side could perform a Merge Points at the end, and WALLAGH! (Or, that could be an option.)

    Conceptually dead simple. I bet it would be slow too. But faster than doing it oneself.
    It sounds like just the scanner needs to be written.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  3. #18
    Now if only there a was a plugin that could give me a barrel with an eagle inside.
    ~~Phil Nolan
    www.philnolan3d.com - Twitter - YouTube
    Win 10 Home x64, Core i7 3.4 GHz, GeForce GT 640, 16GB RAM
    Laptop: Win10 x64, Core I7 8th gen, 1.8 GHz, 16GB RAM

  4. #19
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,741
    Quote Originally Posted by Philbert View Post
    Now if only there a was a plugin that could give me a barrel with an eagle inside.
    Those were the days.

    Seriously, wouldn't it be nice to have a little "Platonics" generator for your own personal platonics? (I realize I'm abusing the word....)

    BTW, what ever happened to the "Thorntagon"? I couldn't find any mention of it online.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  5. #20
    Member
    Join Date
    Oct 2003
    Location
    Near Edinburgh
    Posts
    246

    Script to create scripts

    Ok Jeric,

    This just a quick script to create an lscript from a model. It needs to be tris or quads or both, no 1, 2 on ngon polys or subd. It saves the file to whatever directory you choose. You need to give the file a .ls extension. It takes the name of the file and saves it in the lscript so that you can add it to the menus, it also handles spaces in names.

    I need to think how to cope with non tris and quads, but I'm heading off on holiday shortly so it will need to wait.

    Regards

    Iain.
    Attached Files Attached Files

  6. #21
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,741

    One click to your favorite nurnie or greeble, courtesy iain_r!

    WOW, thanks iain_r! I think this will be a fun addition to our armamentarium.

    (I can't BLEEVE spell check doesn't have "armamentarium" -- I use that word All The Time!)

    Discussion:
    w/o reverse engineering your script: why are ngons an issue? If you are just sequentially selecting polys and replicating their points, don't you get ngons "for free"?

    Thanks man, very cool. Now users can create their own favorite shape in one click! No more making a sphere and merging the pole polys (which are tris) to get all quads! Nurnies at our fingertips!
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  7. #22
    oh corks
    Join Date
    Aug 2010
    Location
    end of the line
    Posts
    888
    Arsenal.

  8. #23
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,741
    that's no fun.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  9. #24
    Member
    Join Date
    Oct 2003
    Location
    Near Edinburgh
    Posts
    246

    Updated file

    Updated script which should now handle polygons with any number of points. I tested this with the gemstone which has 3, 4, and 8 point polys. Worked okay.

    Use at your own discretion.

    Regards

    Iain.
    Attached Files Attached Files

  10. #25
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,741
    Fabulous, Iain. Thanks.

    EDIT: sadly, managed to crash it on my second use. (Was trying to see if the script would retain Surfaces.) Crashed Modeler, and now Modeler won't launch!!! More in a bit.

    Meanwhile, treat with extreme caution....
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  11. #26
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,741

    Exclamation Personal primitives

    Iain_r's "CreateLscript.ls", version2, unfortunately appears to be capable of creating poison lscripts that will prevent LWM and Layout from launching, if Autoscan is on.

    ATTACHED find an example of such a poison script. I suspect that attempting to "Primitivize" larger objects with higher point/poly counts than the script is able to accommodate creats a poison lscript, as the originator script generates safe lscripts from simpler objects.

    Also attached find a safe, non-crashing lscript generated by ian_r's cool lscript.

    If "CreateLscript.ls" can be made safe, either by enlarging array sizes or simply inserting point/poly count checks, I think it will be real fun to have one's own, personal primitives.

    WARNING: to prevent Modeler from failing to launch, delete the "TestObject2.ls" from your plugin folder, or turn off Autoscan.

    TestObject2.ls is the poison script.
    TestObject.ls is the safe script.
    Attached Files Attached Files
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  12. #27
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,741

    Question Possible problems: the generated point list

    I'm no programmer, but taking a glance at the poison generated *.LS, I noticed this bit near the end of the vertice list: that doesn't look right.....

    verts[2362] = <1.24458,1.1982,0.3>;
    verts[2363] = <1.24135,1.24068,0.3>;
    verts[2364] = <1.24111,1.257,0.3>;
    verts[2365] = <-1.#IND,-1.#IND,-1.#IND>;
    verts[2366] = <-1.#IND,-1.#IND,-1.#IND>;
    verts[2367] = <-1.#IND,-1.#IND,-1.#IND>;
    verts[2368] = <-1.#IND,-1.#IND,-1.#IND>;
    What could be going on here? Is 2365 anywhere near a natural limit of LScript arrays?
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  13. #28
    Member
    Join Date
    Oct 2003
    Location
    Near Edinburgh
    Posts
    246
    Jeric, please stop using "poison" to describe the generated lscript.

    I've just run a test using the Draggie model and generated a script with details for 8601 vertices and 8296 polygons and no corruptions are recorded in the file. It's not a limit of lscript arrays as the create file is parsing through the point and polygon information in modeler and it is being written directly to the file.

    The -1.#IND would suggest that the value returned was not a number. Have you tried the script on another model with multple points in the polygons? What does modeler report in the statistics or point information for those points, i.e what values does it display for verts 2365 through to 2368.

    Regards, Iain.

  14. #29
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,741
    Quote Originally Posted by iain_r View Post
    Jeric, please stop using "poison" to describe the generated lscript.
    That's my generic term for "items that load and kill the application", which can be plugins, scripts (apparently), meshes and images.

    It's convenient and descriptive, and discriminates between the perfectly functional files CreateLscript has generated with a minimum of typing. (And 'bad' is boring and vague.)

    Quote Originally Posted by iain_r View Post
    The -1.#IND would suggest that the value returned was not a number. Have you tried the script on another model with multple points in the polygons? What does modeler report in the statistics or point information for those points, i.e what values does it display for verts 2365 through to 2368.

    Regards, Iain.
    I tried it on two different objects that generated, ahem, 'bad' files that prevented the applications from launching. I also generated several perfectly functional smaller items. The bad meshes were extruded 'text objects'.

    I'm away from that machine, but when I get to it I'll make a couple more. Didn't I upload them above?? EDIT: apparently not.
    Last edited by jeric_synergy; 08-26-2012 at 12:19 PM.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  15. #30
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,741

    Post OK, here's some samples

    At home, generated some samples for Iaian_r:

    • attached is the LWO from which the @^@ 'bad' file gets generated.
    • Next attached is the generated file that causes LWM to crash.


    I didn't check ('cuz it's incredibly aggravating), but before, having AutoScan (plugins) ON would prevent LWM and LW from launching, which I find very surprising, since it implies that they both run the lscripts to some degree, on scanning. WUWT?

    Immediately before generating this crashing script I used CreateLscript.ls to generate a file from a simpler mesh, and that one worked fine. (Attachment #3)

    Looking at the bad file's code, I see nothing obvious in the vert or poly list like a previous generated script had.

    So, now you have a culprit to autopsy!
    +++
    EDIT: btw Iain, I'm running 64bit here.
    Attached Files Attached Files
    Last edited by jeric_synergy; 08-26-2012 at 06:46 PM.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •