Wings 3D Development Forum

Full Version: [W.I.P.] Curve Tools plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Still working on it. Mostly, testing and fixing small bugs that I eventually stumble on.

So, by using it sometimes I find situations that I can try to improve it.
I've been working in a vintage phone. I'm using this one as a reference (on image plane):


Here is the curves I drawn. I mostly used Linear type and the Bevel command to add curvature since the idea here is still to produce as low poly as possible - just like we use to do in regular Wings3D modelling:
[Image: old-phone-wip4.png]
* the blue objects are native Wings3D objects

Here is how it's looking with its pieces in the parametric form:
[Image: old-phone-wip5.png]

I think the mouthpiece should be possible to be made with Lathe command, but that requires an unusual "curved axis" of rotation:
[Image: old-phone-wip6.png]
Let see if I find a way to compute that and the result is reasonable. I didn't found any other app with this option. As per definition it happens "around a fixed axis".
Great work!!
The phone is mostly made up from curved objects. Biggrin
It's still not available, but here is the Lathe command using a curve as axis of revolution.

I looked for this option in other 3D App and I couldn't find. Maybe it has another name. If someone knows about it, please let me know.

Usually it's expected to be used a smooth curve for this action, but I can't impose this limit so is up to the user do not try crazy ones expecting to get nice results. (it's impossible) Wink




[Image: Lathe-curve-axis-4.png] [Image: Lathe-curve-axis-5.png]

[Image: Lathe-curve-axis-6.png] [Image: Lathe-curve-axis-7.png]

Now I should be able to build that mouthpiece for the vintage phone. Smile
New update is available:
Code:
- Added the option to use a curve as axis for Lathe. It was necessary to
  create code to segment a curve by using a profile data;
- Added hotkey support with limitations since Wings3D doesn't allow plugins
  to bind its own menus. So, predefined ones were set for Sweep and Lathe;
- Fixed a draw issue when cliking an element without drag it in Tweak mode;
- Fixed a draw issue when selections were moved in a drag operation that
  ended up to be canceled;
- Fixed a crash caused by repeat command in a project that was just loaded;
- Fixed Bevel command which was leaving the initial new vertex when it was
  cancelled;

The Lathe dialog has now two new options to set the axis of revolution: Start/End and Curve.

The Start/End option will use the vector defined by the Start and End vertices and the Curve option allow us to set another curve as axis (as shown in the previous post).


Download link (you can replace the .beams file or use the File->Install Plug-in or Patch option)
Hi! micheus,Thank you for update the plugin Smile
I tried to new verion,and I've felt a few problem for using the new lathe features.

About working procedure.
I have misunderstanded that the second curve deform along the center of a first lathed object.
It probably may not a bug,but it confused me.

A first preview Object remain
Alson ,in some cases, even after setting the second central axis, the already created lathed object of the first axis remains.

Crash log
Sometimes,I have got a folloing crashes log.It happened with suddenly.
This crash occurs when click on the CurveTool Geometry window, and it is no longer possible to open the window by CurveTool mode.
Code:
Dump written 2021-7-30_12-13
Version: 2.2.7
Window: {plugin,{curves,geom}}
Reason: undef

Short stack trace:
[{curve_misc,format_hotkeys,2,[]},
{wpc_curves,show_menu,4,[{file,"wpc_curves.erl"},{line,1220}]},
{wings_wm,handle_event,3,[{file,"wings_wm.erl"},{line,1031}]},
{wings_wm,send_event,2,[{file,"wings_wm.erl"},{line,998}]},
{wings_wm,do_dispatch,2,[{file,"wings_wm.erl"},{line,890}]},
{wings_wm,get_and_dispatch,0,[{file,"wings_wm.erl"},{line,685}]},
{wings,init_part2,3,[{file,"wings.erl"},{line,108}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,226}]}]
Long stack trace:
[{curve_misc,format_hotkeys,
             [[{"Snapping  [NO]",snapping,
                "Toggle snap vertices to an element in Wings3D's object"},
               separator,
               {"Linear",linear,"Starts a new linear curve"},
               {"Smooth",smooth,"Starts a new smooth curve (Catmull-Rom)"},
               {"B-Spline",nurbs,
                "Starts a new clamped B-Spline curve using CV curve method (cubic B-Spline)"},
               {"B**er",bezierer","Starts a new B**er curve"},
               separator,
               {"Circle",circle,"Creates a circle along the standard axis",
                [option]},
               {"Helix",#Fun<wpc_curves.11.39080184>,
                {"Creates a helix along the standard axis or curve"}}],
              curves],
             []},
{wpc_curves,show_menu,4,[{file,"wpc_curves.erl"},{line,1220}]},
{wings_wm,handle_event,3,[{file,"wings_wm.erl"},{line,1031}]},
{wings_wm,send_event,2,[{file,"wings_wm.erl"},{line,998}]},
{wings_wm,do_dispatch,2,[{file,"wings_wm.erl"},{line,890}]},
{wings_wm,get_and_dispatch,0,[{file,"wings_wm.erl"},{line,685}]},
{wings,init_part2,3,[{file,"wings.erl"},{line,108}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,226}]}]

OS: macOS Version 10.16 (Build 20G80)
GPU: ATI Technologies Inc. | AMD Radeon Pro 5300 OpenGL Engine

Note: Mask ** = 躩(U+8EA9 in utf8 )= éz; Beézer
Curiously, this part was Mojibake.
And The string that charcode contain can't copy paste to browser. Sad
tkbd, thanks for the report.

I'm still waiting for you to give me a feedback in the email I sent you.

But, just to not let this post without an answer, here is the following...

- The update to fix the unicode issue is in the email I sent you, but I would like if its really OK;
- The cause of the crash was fixed as well. I don't know what happened, but one module seems to not be updated properly since I tested and used the hotkeys and they were shown on menus;
- I'm still checking the "first preview Object remain"
Hi! micheus,Thank you for Email
I apporogy for the late replied of the email.
so,I sent files to you that the test results, errors log, and wings files.
(Ofcause ,It is updated curve plugin using a file you sent. )
tkbd Wrote:I apporogy for the late replied of the email.
so,I sent files to you that the test results, errors log, and wings files.
No need to apologise and thanks for the feedback.

It ended up that the crashes were not related to UTF8 characters.


New update is available:
Code:
- Fixed a crash caused by Dissolve command for edge and face selection mode;
- Fixed the use of default resolution set in preferences for circle creation
  (LMB option);
- Fixed Duplicate command in order to correctly to clone Lathe objects using
  the axis curve;
- Fixed a crash when invoking Object Property for a curve without an object
  assigned; Thanks tkbd for report it;
- Fixed a crash when invoking the context menu having edges selected in a
  Wings3D object; Thanks tkbd for report it;

Download link (you can replace the .beams file or use the File->Install Plug-in or Patch option)
Another feature for the Curves tool would be the ability to convert edges in Geometry to linear curves

Like, for instance, selecting the edges on the surface of a sphere and then using a "Edges to Curves" command would generate new curves exactly where those edges were in the geometry space.

The user would also have to specify a start and end to the generated curve and I'm not sure if it's possible to make multiple generates curves all at once.

I know the snapping command exists, but this feature would allow for more options when designing new curves, as well as allowing the L hotkey to be implemented in the process.
VictorLincolnPine Wrote:Another feature for the Curves tool would be the ability to convert edges in Geometry to linear curves
It's already there. Smile

Select some edges sequence (or loop) in an object in the Geometry window and in the Curves geometry window in context menu you must to find the option "Convert to ..." available.
Just be sure to not have any other curve selected.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14