Multiple symmetry update
 1-7  8-27  28-39

Previous
Next
 From:  TOM (SIRTOM)
7888.28 In reply to 7888.27 
First, I draw the curves.
Then, I create solids out of them with loft or network.

As I am designing a symmetrical object, it is much faster to use a script
than apllying the symmetry command several times.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7888.29 In reply to 7888.28 
Hi Tom, can you post an example file that has one of your curves that you are replicating and then using Loft and Network on?

I just did a quick test over here, and I was able to use the symmetry script to generate curves, then did a loft through those curves and it is updating fine for me when I edit the original curve.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  TOM (SIRTOM)
7888.30 In reply to 7888.29 
Hi Michael,
Here an example with network (3 repetions / arrays)

The script runs with the curves but it does not multiply the network.

EDITED: 30 May 2016 by SIRTOM

Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7888.31 In reply to 7888.30 
Hi Tom, thanks for the example, sorry I didn't quite understand what you were trying to do before.

The script will need to be modified to work on things other than curves, it currently only collects curves to replicate just because that's what you originally described as what you were trying to do.

To make it work on any kind of object, edit line 13 of the file MirrorRotateHistoryArray.js which currently has this:

code:
	var curves = moi.geometryDatabase.getSelectedObjects().getCurves();


Change it to remove the ".getCurves()" part, so that line should look like this instead:

code:
	var curves = moi.geometryDatabase.getSelectedObjects();


With that line changed, it should then work to replicate any kind of objects.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  TOM (SIRTOM)
7888.32 In reply to 7888.31 
Hi Michael, very cool ! I had thought thaht it could be done by changing just
one term. merci !
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  mkdm
7888.33 In reply to 7888.31 
Hi Michael,

Based on your previous suggestions, i wrote a little variant of your plugin, that supplies a minimal UI.
Its javascript code is not very elegant but it seems to work.

Using its UI it's now possible to choose the working plane and if or not apply the mirror command.
If the selected mirror axis is incongruous in relation to the working plane, the script will use a default axis for that particular working plane.

I tried to write a version that could show a preview before commit the results,
but without success.

I think the problem is that the entire process it's not made by a single factory command, but by multiple commands.

Could you please suggest an easy way to achieve this goal ?

Thank you and have a nice day !

Marco (mkdm).

Image Attachments:
Size: 583.8 KB, Downloaded: 61 times, Dimensions: 1915x1033px
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7888.34 In reply to 7888.33 
Hi Marco, that's a nice version!

To make a version that would do a preview, you would need to remove the current WaitForDialogDone() event loop at the top of the function and instead make your own event loop (look inside WaitForDialogDone.js for an example), and when any of your UI controls triggers an event you'd need to call factory.cancel() on any factories that you have created.

You would probably want to restructure the code to do that, like keep a list of current factories in a global variable, and move the object generation code into its own separate function so you can call it more easily from different locations because you'll also want to generate things before you go into the event loop so that the use sees the initial result using the initial default values.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  mkdm
7888.35 In reply to 7888.34 
Hello Michael,

Thank you very much for your suggestions!

Certainly i will try to write a new javascript code that will follow your instructions.

Nice night.

Marco (mkdm).
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  TOM (SIRTOM)
7888.36 In reply to 7888.35 
Very nice - makes handling easier !
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  mkdm
7888.37 In reply to 7888.34 
Hi Michael,

More or less :) i followed your instructions and now here's my 0.2 version of the MirrorRotateHistoryArray2 command.

Now it provides full preview of the resulting geoms and includes also the "Angle" input field.

After some tests it seems that all works fine, but please let me know if you find some bugs.

In your opinion, the javascript code i have written, performs a correct cleanup of the previewed objects, while cancelling the command
or call the main function more then one time (for ex. when the user modify the input values) ?

Here's the code fragment...

code:
	// step 1 : cancel the preview factories, created in the previous call
	if (previewFactories.length > 0) {
		for (i = 0; i < previewFactories.length; i++) {
			previewFactories[i].cancel();
		}
		previewFactories = new Array();
	}


Nice day!

Marco (mkdm).

Image Attachments:
Size: 603.5 KB, Downloaded: 44 times, Dimensions: 1920x1035px
Size: 858 KB, Downloaded: 42 times, Dimensions: 1918x1035px
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7888.38 In reply to 7888.37 
Hi Marco,

> In your opinion, the javascript code i have written, performs a correct cleanup of the previewed
> objects, while cancelling the command
> or call the main function more then one time (for ex. when the user modify the input values) ?

Yes that looks correct - calling factory.cancel() like that should make each factory erase the objects that they had generated on previous calls to factory.update().

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  mkdm
7888.39 In reply to 7888.38 
Hi Michael,

> Yes that looks correct - calling factory.cancel() like that should make each factory erase the objects
> that they had generated on previous calls to factory.update().

Ok, Thanks!

Marco (mkdm).
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages:  1-7  8-27  28-39