10-02-2023, 07:59 AM
Sorry but I come with yet another trouble. Simple python script for new shape creation does not create new shape.
Please help with troubleshooting. Details: Nothing in erlang console. W3D log window: wpc_scripting_shapes:command/3: bad return value: {shape, {shape_from_script, {{command_rec, [["type","py"], ["name","Test Shape"]], "c:/Users/kav/Documents/new_shape_test/test_shape.py", "py",[]}, []}}} test_shape.py: (should generate 2x2 cube) Code: import w3d_e3d test_shape.wscr: type "py" name ?__(1,"Test Shape") ivla Wrote:Sorry but I come with yet another trouble. Simple python script for new shape creation does not create new shape. I tested it and it seems there has to be at least one parameter, a bug in the script plugin, which I'll try to find time to fix soon. Add to test_shape.wscr: Code: params { After that the error is further into parts where the E3D that was constructed might cause errors, I recommend trying with the simpler NewShape form which only takes fs and vs. Code: nshp = w3d_newshape.NewShape() Here I notice a combine_half_edges error, which might mean one of the faces might be facing the other direction. You'll need to change the first face: [0,1,2,3] to [0,1,3,2] And the vertices have to be floats, it can cause weird errors in wings if there are integers in the mesh: [(-1,1,-1),(-1,1,1),(1,1,-1),(1,1,1),(-1,-1,-1),(-1,-1,1),(1,-1,-1),(1,-1,1)] now [(-1.0,1.0,-1.0),(-1.0,1.0,1.0),(1.0,1.0,-1.0),(1.0,1.0,1.0),(-1.0,-1.0,-1.0),(-1.0,-1.0,1.0),(1.0,-1.0,-1.0),(1.0,-1.0,1.0)] EDIT: I forgot to mention about the main function: Code: def mnewshape(): Code: def mnewshape(params, params_by_key, extra_params):
10-04-2023, 03:55 AM
Thank you, it works as expected.
10-11-2023, 10:30 AM
Profiled thread generator:
thread.zip (Size: 2.31 KB / Downloads: 2) Currently only ISO/DIN13 profile.
10-12-2023, 10:58 PM
That looks great ivla.
The wscr doesn't yet have a way to choose from a list, I'd have to implement that. You can add preview easily by adding to .wscr: params_preview 1 I'm not sure of the best approach about the thread ends geometry, personally I'd probably try to triangulate it with a central point.
10-13-2023, 07:33 AM
(10-11-2023, 10:42 AM)ivla Wrote: 2. How to construct the thread ends? I don't like the current way (especially upper end).I don't know if that can help you to evaluate ways to construct it, but I just shared three type of bolts I've made starting from the Threads primitive (here). I think that is something that require a good attention to get it right - I'm not sure that is possible to create and automatized way to build it for many cases. |
|