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

Add configuration file that allows specifying a default model #123

Closed
hannobraun opened this issue Feb 2, 2022 · 2 comments · Fixed by #362
Closed

Add configuration file that allows specifying a default model #123

hannobraun opened this issue Feb 2, 2022 · 2 comments · Fixed by #362
Assignees
Labels
type: feature New features and improvements to existing features

Comments

@hannobraun
Copy link
Owner

When Fornjot is started without a command-line parameter to select a model, it loads a default model (currently models/cuboid). This is useful for development (cargo run without parameters results in something useful), but is just weird behavior if a Fornjot binary is run outside this repository:

  • A user just starting Fornjot will get a confusing error message about some model they never heard of not being found.
  • We might want to have different behavior for the "no parameters" case, like showing an "open file" dialog.

To address these problems, while at the same time preserving the ease of development, I propose adding a configuration file that allows for specifying a default model. I prefer TOML for these kinds of files. Here's what that could look like:

# The file could be called `Fornjot.toml`
default_model = "path/to/my-model"

Issues #38 and #56 are related.

@hannobraun hannobraun added type: feature New features and improvements to existing features topic: model labels Feb 2, 2022
@hannobraun hannobraun added this to the Basic Usability milestone Feb 2, 2022
@hannobraun
Copy link
Owner Author

In addition, it should also be possible to specify a default model path. For example, if the following were specified in Fornjot.toml:

default_path = "model"

Then fj-host -m my-model should load the model from models/my-model. This would further enable keeping the current behavior when running from this repository, without making behavior outside this repository weird and confusing.

@hannobraun
Copy link
Owner Author

I'm working on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New features and improvements to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant