Thank you very much - and I think that hand-building a polygon from a list of points may be my best bet at the moment. I can easily create points from my parametric equations, and then join them up.
Posts made by Alasdair McAndrew
-
RE: Curves described by parametric equations?
-
Student projects?
As a few of you may know, I am a university academic, and currently I am collecting topics suitable for final year capstone projects. I have several personal "vanity" projects I can give students, which would both keep the teams busy and produce useful results, but in fact projects work better with an external sponsor. If nothing else, students feel that they are genuinely involved in a useful project, which encourages greater engagement.
If anybody has projects which you think may be suitable for a team of final year IT students, please let me know!
Of course, it may be that no team chooses that project, but it's always nice to extend the range of our projects.
This year I supervised two teams: one created a proof-of-concept for an app for Aged Care management (specifically so that loved ones could check up on the health and care of their relatives); the other team worked on a method for automatic identification of individual specimens of the striped legless lizard (Delma impar), a local endangered species.
Thanks very much,
Alasdair -
Curves described by parametric equations?
Is it possible (in JSCAD) to draw a curve in space defined by parametric equations x = x(t), y = y(t), z = z(t) over an interval of t? What I want to do is to draw a cylinder with a sort of "wavy" top; in my case the shape of the edge can be given as a parametric curve.
Thanks!
-
RE: Two questions about projections
@z3dev Thank you very much. I would particularly like the option of orthographic viewing or rendering, but both the documentations and websites (for the new V2, and the original) seem quiet on the topic.
-
Two questions about projections
-
I have several shapes which are best viewed in one particular position. Normally I just create the shape centered (more-or-less) about the origin, and then move it around until it looks the way I want. Is there any way of finding the current position and orientation of the shape (with respect to the camera) so that I can write the position into the original script?
(I know that I can have rotations and translations as parameters, and use the results of that, but I'm wondering if there's a simpler way.) -
In the web viewer (jscad.xyz, or its local version demo.html) I can't seem to switch between perspective and orthographic views. The settings claim that the keys "p" and "o" move to each projection, but I can't get my keys to have any affect at all. How can I obtain an orthographic projection in the web viewer, and/or can the projection be written into the original JavaScript file?
Thank you all!
-
-
RE: Cylinder between points?
@hrgdavor That looks terrific! I'm working on a similar one, but trying to see what happens if two of the coordinates are equal, or zero. That is, if the x-coordinates of p1 and p2 are equal, or the y-coordinates, etc. Or if some of them are zeros. For example, in your computations of ay and az, you're using an inverse tangent, but what happens if either dx = 0, or dz = 0?
I decided to first translate p1 and p2 to 0 and p2-p1 or p1-p2, depending on which had a positive z-coordinate. Then we are simply rotating things in the z>=0 half-space, which reduces everything to two rotations (as you have).
But I do like the simplicity and elegance of your code: clearly you're a more advanced JavaScript programmer than me. Did you work all this out from scratch, or are you taking another program and rewriting it?
The other possible issue is that the result should be independent of the order of p1 and p2: it may be that your function does that automatically, but I found it tricky with mine.
Thank you very much indeed.
-
Debugging: values of variables?
If I want to do a little development work - which in my case is simply creating a few small functions - some debugging facility is necessary. I know that (at least in Firefox) I can write to the Web Console with the JavaScript function
console.log
- but are there are other debugging facilities? This might seem like a dumb question, but I've only ever used JavaScript in the context of (Open)JSCAD, so I know nothing about generic JavaScript debugging. How do you step through a script or program, checking values of variables on the way? Add breakpoints?As always, many thanks!
Alasdair -
Cylinder between points?
At the risk of being a pain in the neck (or choose other part of the body) with all my current enquiries, I have another one. In V1, and in CSG, we had the (for me) very useful functionality of being able to construct a cylinder between two given points. This does not seem to exist in V2. Now I know that a cylinder between two points can be constructed first by determining a height as the Euclidean distance between the points, and width, and then using appropriate rotations and a translation to move it into its place. But this is a non-trivial task (how would you construct a cylinder between (-2,3,5) and (-4,-1,7) for example?) which would be rendered much easier by being able to construct a cylinder between two points. Will this be added, or is this one of those libraries to be added by users to make up any loss of functionality from V1 and CSG? (We expect REMOVED functionality to be supported via small user libraries.) If so, I'd better get to work!
Thanks,
Alasdair -
RE: Camera position, V2?
Nice - thank you! Should this be listed in the various shortcuts under the settings menu?
-
Camera position, V2?
I believe this might have been asked before in respect of V1 somewhere: but is it possible to change the initial camera (viewing) position? I know I can get the same effect by judiciously placing the figure with translations and rotations, but sometimes it's much easier to move the camera, as it were. Thanks!
-
RE: Issues on Linux - designs not rendering in html viewers
@z3dev Thanks - but can it be embedded somehow in another webpage?
-
RE: Issues on Linux - designs not rendering in html viewers
@z3dev Thank you again! The web demo works very nicely, and I can pull examples into it and play around with them. It seems much faster than V1, although the scripting seems significantly different - although maybe that's just my lack of experience with V2.
However - the
viewer-minimal.html
file still refuses to render anything, even when I update thedesign-url
to point to an existing file... I'll do a bit more reading and searching. Again, many thanks. -
RE: Issues on Linux - designs not rendering in html viewers
@z3dev Thanks very much - I'll give that a go (when I've finished a current round of marking - I'm a university academic). Do you recommend installing as a user or as root? Like most Linux users, I'm the only non-root user on my system, but on the other hand I like to separate all my personal files (which are in the
/home
folder) from system files, which includes applications and libraries, most of which are under/usr
. -
Issues on Linux - designs not rendering in html viewers
I have just downloaded a new version of OpenJSCAD onto a recently upgraded Archlinux distribution. I last used OpenJSCAD - on this same system, but an earlier version - about a year ago. However now I have a minor, but annoying, issue. I can view designs in the
index.html
page by dragging and dropping the jscad script into it. So my browser indeed supports both JavaScript and WebGL.But what I can't do is view a design in either of the two html viewers. In fact opening up either viewer shows a blank area except for the openjscad xy plane. In neither viewer is the design rendered. I've checked the source for
min.js
andmin.css
and they're both there, and being pointed to correctly by the viewer's html code.Clearly I'm either missing something obvious, or I need to add something else to my system for this to work. In any case I want to use the viewers as tests for adding some of my shapes to webpages.
What might be going wrong that a shape is not being rendered in an html viewer?
-
RE: Hosting/publishing a shape?
@hrgdavor Many thanks - I do in fact have a gist account, which I've used only a very little bit. I guess the main issue would be in reading the JavaScript files necessary for OpenJSCAD. All it really needs is the
dist/min.js
file and some of themin.css
file as well, maybe... Thank you again. -
Hosting/publishing a shape?
I have a few shapes I'd like to share with some people who don't themselves use OpenJSCad - all I want to do is make the finished shapes available for them to play with. I do in fact host my own webserver on a VPS, but most of it is off-line while I re-build bits of it I managed to destroy.
So I'm looking for a temporary solution: somewhere I can put up a shape that can be viewed by others. Any ideas?
Thanks,
Alasdair -
RE: Transparency, progress bar?
Thank you both about the transparency information: adding an alpha parameter to RGB seems like a simple and effective approach. Me being lazy though, I usually use named colours:
color("disgustingbrown",my_shape);
I guess my other question about a progress bar in the viewer is either not possible, or too fiddly to be practicable?
Thanks again!
-
Transparency, progress bar?
I am just experimenting with OpenJSCAD again after some time away from it. My preferred options are to create a jscad file, and an html file which points to it (using the viewer with options), and view the resulting html file. On my current Windows 10 system, Firefox is a better browser than Chrome. Anyway, I have two questions:
- Is it possible to create objects which are partly transparent? Or is that browser (and renderer) dependent? And if so, how? There' a tantalizing reference to transparency in the documentation - in the color section - but no saying how to implement alpha transparency in an object.
- Progress meter/bar in the viewer? Sometimes a figure will take a while to render and load; other times it won't render at all because of an error in the jscad file (one not caught by the interpreter). Here some sort of progress bar would be very useful - is there a way of adding one to the viewer?
That's it for the moment - thank you very much!
Alasdair