-
Notifications
You must be signed in to change notification settings - Fork 485
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
Introduce 'ViroCircle' shape #316
Comments
Hi @oOMoeOo, this is great, thank you for this and thanks for the code! We have been discussing adding more primitives as well as a path functionality for more complex curves. When we do include those components we will update this issue to let you know. |
Hi @oOMoeOo, What is the code for ../../business/scene/Polyline? I only see the Circle and Point2D components. |
I cannot share you the full code but this snippet should make it working. You don't need the polyline class. It is just a wrapper for a point array with some utility functions. `
} |
Thanks @oOMoeOo, I'm goint to testing your code for my app. |
Hi,
i'd like to share you some code that creates a simple polyline based circle. Maybe it could be the starting point for introducing ViroCircle into the core api. I think that supporting more svg elements like circle, path and so on would create a great benefit for simple geometry based ar experiences.
The types are based on flow.
`import React from 'react';
import {ViroPolyline} from 'react-viro';
import Point2D from '../../business/scene/Point2D';
import Polyline from '../../business/scene/Polyline';
export type Props = {
radius: number,
thickness: number,
radialSamples: number,
position?: number[],
rotation?: number[],
scale?: number[]
}
type State = {
circleLine: Polyline
}
export default class Circle extends React.Component<Props, State> {
}`
`export default class Point2D {
x: number;
y: number;
}`
The text was updated successfully, but these errors were encountered: