gh-svg | exporting geometry from Grasshopper/Rhino to SVG data format | Animation library
kandi X-RAY | gh-svg Summary
kandi X-RAY | gh-svg Summary
Note: This code is no longer under active development. See below for more details. gh-svg is a plugin for exporting svg data from the Grasshopper and Rhino 3D modeling environments. The intent is work towards create greater interoperability between different geometry editing softwares using open-source data format standards, as well as making it easier to create dynamic interfaces for topics that rely heavily on illustration and geometry, such as architecture, urban design, industrial design, and data visualization. Here's an example. And another example.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of gh-svg
gh-svg Key Features
gh-svg Examples and Code Snippets
Community Discussions
Trending Discussions on gh-svg
QUESTION
There are relatively straightforward ways of accomplishing this in vanilla Javascript (see this for one such approach), but I'm struggling getting something like this to work in React, particularly with an animation library like Framer Motion.
Framer Motion's useViewPortScroll returns a handy scrollYProgress object whose "current" property tells you what percentage down the page the user is currently scrolled.
I'd like to use this property to do something like this: const pts = path.getPointAtLength(scrollPercentage * pathLength);
, and then use pts.x
and pts.y
for the x and y attributes of, say, a circle SVG - so every time I scroll down (or up) the page, the position of the circle would update/animate along the SVG path.
I'm struggling getting this to work with React's more declarative style, as I'd have to use refs for both the circle and the path elements, meaning I would have to place the aforementioned pts = path.getPointAtLength...
code inside of a useEffect call, with both refs as dependencies (or else the refs would be undefined, in which case the pts.x
and pts.y
properties on x and y of my circle SVG would be inaccessible on first render.
Has anyone solved a similar problem or could possibly provide guidance?
...ANSWER
Answered 2020-Jul-18 at 23:10For such a simple animation (dot rotating around the circle) you could make use of simple transform: rotate()
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gh-svg
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page