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

getting started on octave #132

Open
ivanrojasch opened this issue Aug 17, 2022 · 4 comments
Open

getting started on octave #132

ivanrojasch opened this issue Aug 17, 2022 · 4 comments

Comments

@ivanrojasch
Copy link

Hi
I'm working a code in Octave, and need some features from matgeom. Mainly the capability to draw many contiguous boxes, with square faces on top, and different depths. I already downloaded the main 1.2.5 version files, and corresponding manual, and read the README file here on Github and made all of my effort to get it working, but still can't do it. Is there a clear way on which I can start using the functions? do I have to run a file, or many of the files from the "inst" folder that came with the package?

thanks in advance

@dlegland
Copy link
Member

Hi,

I am not very familiar with octave, so it will be complicated for me to find solutions, but in theory MatGeom is mostly compatible with octave.

Some starting points:

  • MatGeom is a library of functions, so to use it you need to call a function from the command line with the adequate set of parameters. There is no GUI, nor running script.
  • To be able to use a function, its folder should be visible by octave. The matlab function is 'addpath", the same should be valid for octave. There is a setup script at the root folder that adds all directories of matgeom to the path.
  • Maybe a minimal test could be:
> addpath('geom2d');
> drawCircle([20 20 10], 'b');

(that should draw a blue circle in a new figure.

  • otherwise, if you are already writing some octave code / script and the code you need is very specific, one way could be to add the necessary lines directly into your script.

hope this helps?

@ivanrojasch
Copy link
Author

Thank you very much. Your response has helped me to begin this quest =D
The minimal test needed an extra step, because a function was being called from another path:

addpath('utils');
addpath('geom2d');
drawCircle([20 20 10], 'b');
If I got it right, I should keep the MatGeom library of functions on the same folder as the script I'm coding (which needs functions from MatGeom) and include the needed addpath(_____) from what will be used in the script. Kind of the thing done in Python with the "import" command, such as import numpy, import matplotlib.pyplot, import scipy, etc.

Regards

@dlegland
Copy link
Member

Hi,
yes, exactly!
The principle for both platforms/languages is the same, except the dependency management with Matlab (and I suppose for octave) is not as simple as with python.

In practice, I use it the way you describe: working within the directory containing the script, and adding the necessary paths.

With Matlab it is possible to define a set of paths that are loaded at each startup. That makes simple simpler when restarting a session. I suppose this should exist for octave too.

Best,
David

@ivanrojasch
Copy link
Author

I did a little bit of reserach, and added the following to the beginning of my script:
addpath(genpath('matgeom-1.2.3'));

A first stage of what I needed is already achieved, now I'm still working on the data and how to interpret it. But for now, I know how to draw what I needed. Once again, thank you very much
WhatsApp Image 2022-08-18 at 6 24 08 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants