mcneel / compute.rhino3d

REST geometry server based on RhinoCommon and headless Rhino
Other
284 stars 182 forks source link

Overridable `GrasshopperDefinition` #392

Open talebia opened 3 years ago

talebia commented 3 years ago

I wanted to know if there's any reason as to why the GrasshopperDefinition cannot be overridden (private ctor)?

sbaer commented 3 years ago

Why do you feel you would need to override the constructor?

talebia commented 3 years ago

@sbaer I dont need to override the ctor, I would need to override the Solve behaviour so it expires all the cache before creating new solution for a specific script: Definition.NewSolution(true, GH_SolutionMode.CommandLine);

So either update the Solve method to accept a boolean arg (not following Open-Close principle) or have the entire GrasshopperDefinition class overridable so the Solve can be overridden?

sbaer commented 3 years ago

I'm sorry, but I really don't understand the goal here. Could you provide either a pull request or some code here to help me better understand?

talebia commented 3 years ago

sure created a PR: https://github.com/mcneel/compute.rhino3d/pull/393

sbaer commented 3 years ago

Thanks, I think I understand now. We would need to add a bool to the input sent to compute to tell it to expire all objects.