Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can we have "interactive parameters" like parametricparts.com? #19

Closed
stansu opened this issue Dec 9, 2014 · 9 comments
Closed

can we have "interactive parameters" like parametricparts.com? #19

stansu opened this issue Dec 9, 2014 · 9 comments
Labels

Comments

@stansu
Copy link
Contributor

stansu commented Dec 9, 2014

Parameters: (Optional) Defines parameters and their default values, which can be manipulated by users to customize the object. Parameters are defined by creating local variables of a particular class type. Presets and groups organize parameters to make them easier to use

http://parametricparts.com/docs/fileformat.html

@dcowden
Copy link
Collaborator

dcowden commented Dec 10, 2014

Hi, stansu:

We talked about this quite a bit-- and in fact it was a huge discussion
when parametricparts.com was created too.

The question is: what's the best way to support parameters? We've found a
few things would be ideal:

(1) a script in the CQ-freecad-plugin would work when cut-and-pasted
directly into ParametricParts. This would ideally, include metadata for
parametrics

(2) scripts can use variables directly, like circle(fooDiameter) instead of
having to do what PP does now, like circle(fooDiameter.value).

(3) it should be possible to create scripts without parameters. some users
dont really care

(4) parameter validation can reference other parameter values and use
expressions. parameter validation is very complex. though initially it
seems like each parameter can have min,max, type, and preset values, in
even simple objects this breaks down. Consider, for example, a cylinder
with a hole. in this case there are three parameters-- two diamters and
the height. all three have simple > 0 constraints. easy. but the inner
diameter even in this simple object already has a constraint that is
related to the outer diamter: innerDiamter < outerDiameter. On a
development branch for PP i have a new Parametric framework, and there i've
eliminated the idea that constraints are built into a parameter, because
these kinds of relationships cannot be handled.

(5) scripts are simple. today's PP format requires that a build() method
be defined. that is so that i can parse the script on the server, inject
user-supplied values for the parameters, and then run the build method. It
would be better if the script didnt have a build method-- its just one
script. but then there are other questions: how do you return the solid?
how do we inject new variable values without running the script?

Do you have any thoughts on these ?

On Mon, Dec 8, 2014 at 9:18 PM, stansu notifications@github.com wrote:

Parameters: (Optional) Defines parameters and their default values, which
can be manipulated by users to customize the object. Parameters are defined
by creating local variables of a particular class type. Presets and groups
organize parameters to make them easier to use

http://parametricparts.com/docs/fileformat.html


Reply to this email directly or view it on GitHub
#19.

@stansu
Copy link
Contributor Author

stansu commented Dec 10, 2014

Can you give me your discussion's link? I think it is better to give you advise before knowing what you been discussed.

I want "interactive parameter" like those on parametricpart.com, is because sometimes I want to "interactive debug" my script. By tuning parameters, I can see my script visually progress. It helps me to learning cadquery.

Thanks for your reply.

@dcowden
Copy link
Collaborator

dcowden commented Dec 11, 2014

Actually I think those discussions were all pms with Jeremy not online....

Most of the discussions were around the topics I summarized.

What do you think a good script format would be?
On Dec 10, 2014 5:05 PM, "stansu" notifications@github.com wrote:

Can you give me your discussion's link? I think it is better to give you
advise before knowing what you been discussed.

I want "interactive parameter" like those on parametricpart.com, is
because sometimes I want to "interactive debug" my script. By tuning
parameters, I can see my script visually progress. It helps me to learning
cadquery.

Thanks for your reply.


Reply to this email directly or view it on GitHub
#19 (comment)
.

@stansu
Copy link
Contributor Author

stansu commented Dec 11, 2014

i see.
about your ideas...

(1) do you mean a plugin can automatic convert script to PP script?

(2) i like this.

(3) i like this too.

(4) i have try some parameter relation on http://parametricparts.com/parts/rvj87x56/
when you increase grid inner counts, it inner gap length and grid outer length will be adjust.
is this what you mean parameter validation?

(5) maybe like freecad script objects?
quote..."Properties are the true building stones of FeaturePython objects. Through them, the user will be able to interact and modify your object." http://www.freecadweb.org/wiki/index.php?title=Scripted_objects

and finally, i think a good script format is as freedom as possible. in order to reuse many python script out there.

those is my humble opinions, :)

@dcowden
Copy link
Collaborator

dcowden commented Dec 11, 2014

Actually we were thinking that a script in cadquery IS a valid PP script
with no conversion required...

I really don't like freecad script objects. I found them too complex given
what they do.
On Dec 10, 2014 7:55 PM, "stansu" notifications@github.com wrote:

i see.
about your ideas...

(1) do you mean a plugin can automatic convert script to PP script?

(2) i like this.

(3) i like this too.

(4) i have try some parameter relation on
http://parametricparts.com/parts/rvj87x56/
when you increase grid inner counts, it inner gap length and grid outer
length will be adjust.
is this what you mean parameter validation?

(5) maybe like freecad script objects?
quote..."Properties are the true building stones of FeaturePython objects.
Through them, the user will be able to interact and modify your object."
http://www.freecadweb.org/wiki/index.php?title=Scripted_objects

and finally, i think a good script format is as freedom as possible. in
order to reuse many python script out there.

those is my humble opinions, :)


Reply to this email directly or view it on GitHub
#19 (comment)
.

@jmwright
Copy link
Owner

@stansu You might be interested in the discussion on parameters that's going on here.

@stansu
Copy link
Contributor Author

stansu commented Dec 18, 2014

@jmwright thanks!

@jmwright
Copy link
Owner

jmwright commented Jan 8, 2015

I have found a couple of situations where it would be very helpful for me personally to have interactive parameters like this, especially booleans that could be toggled with shortcut keys. The following are the two scenarios I currently have on my mind.

  1. I have an xray boolean that toggles transparency on parts so that I can more easily view the interior of an assembly. It would be cool to be able to toggle this, and maybe increase and decrease the transparency setting, easily through key bindings and/or GUI controls.
  2. My assembly has both a retracted and extended state. It would be great to have a key binding or quick way to access the "retracted" boolean for this state within the GUI. This one would take priority over number 1 for me actually. This would allow me to quickly view how the changes I'm making are effecting the two extreme positions of the assembly.

@dcowden
Copy link
Collaborator

dcowden commented Jan 8, 2015

yeah, i agree that both are useful.

Solidworks and Pro/E call the second type a "configuration"-- its the same
as what parametricparts calls a "preset"-- a set of pre-defined values of
all parameters ( or a subset ) that reflect set values.

In Solidworks, you can actually attach an excel spreadsheet to a part, and
generate an arbitrary number of configurations that are driven from the
spreadsheet.

On Thu, Jan 8, 2015 at 11:21 AM, Jeremy Wright notifications@github.com
wrote:

I have found a couple of situations where it would be very helpful for me
personally to have interactive parameters like this, especially booleans
that could be toggled with shortcut keys. The following are the two
scenarios I currently have on my mind.

  1. I have an xray boolean that toggles transparency on parts so that I
    can more easily view the interior of an assembly. It would be cool to be
    able to toggle this, and maybe increase and decrease the transparency
    setting, easily through key bindings and/or GUI controls.
  2. My assembly has both a retracted and extended state. It would be
    great to have a key binding or quick way to access the "retracted" boolean
    for this state within the GUI. This one would take priority over number 1
    for me actually. This would allow me to quickly view how the changes I'm
    making are effecting the two extreme positions of the assembly.


Reply to this email directly or view it on GitHub
#19 (comment)
.

dcowden added a commit that referenced this issue Oct 26, 2015
Added the example for using FreeCAD and CQ objects interchangably.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants